GithubX

Drawer

A panel that slides in from the edge of the screen.

## installation

pnpm dlx shadcn@latest add https://ascii.cnlibs.com/r/drawer.json

## usage

import { Button } from "@/components/ui/button";
import { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger } from "@/components/ui/drawer";
<Drawer>
  <DrawerTrigger render={<Button variant="outline">Open</Button>} />
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Quick actions</DrawerTitle>
      <DrawerDescription>
        Swipe down or press escape to dismiss.
      </DrawerDescription>
    </DrawerHeader>
    <div className="flex flex-col px-[2ch]">
      <span>&gt; restart session</span>
      <span>&gt; clear cache</span>
      <span>&gt; view build logs</span>
    </div>
    <DrawerFooter>
      <DrawerClose render={<Button variant="outline">Close</Button>} />
    </DrawerFooter>
  </DrawerContent>
</Drawer>