# V drawer 9

> Basic drawer

A shadcn/ui block from the [@cnippet](https://ui.cnippet.dev/) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/cnippet/v-drawer-9).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-drawer-9
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-drawer-9-light-0a48fef6526ca09b.png
- Registry item: https://ui.cnippet.dev/r/v-drawer-9.json
- Categories: drawer
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.cnippet.dev/r/v-drawer-9.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@cnippet/drawer`

## Files

### `registry/default/variants/v-drawer-9.tsx`

```tsx
"use client";

import { TrashIcon } from "lucide-react";
import { useState } from "react";
import { Button } from "@/registry/default/ui/button";
import {
  Drawer,
  DrawerClose,
  DrawerDescription,
  DrawerFooter,
  DrawerHeader,
  DrawerPopup,
  DrawerTitle,
  DrawerTrigger,
} from "@/registry/default/ui/drawer";

export default function Component() {
  const [deleted, setDeleted] = useState(false);

  if (deleted) {
    return (
      <div className="flex flex-col items-center gap-2 text-center">
        <p className="font-medium text-sm">Account deleted.</p>
        <Button onClick={() => setDeleted(false)} size="sm" variant="outline">
          Undo
        </Button>
      </div>
    );
  }

  return (
    <Drawer>
      <DrawerTrigger render={<Button variant="destructive" />}>
        <TrashIcon className="size-4" />
        Delete account
      </DrawerTrigger>
      <DrawerPopup>
        <DrawerHeader>
          <DrawerTitle>Delete account?</DrawerTitle>
          <DrawerDescription>
            This will permanently delete your account and remove all associated
            data. This action cannot be undone.
          </DrawerDescription>
        </DrawerHeader>
        <DrawerFooter>
          <Button
            className="w-full"
            onClick={() => setDeleted(true)}
            variant="destructive"
          >
            Yes, delete my account
          </Button>
          <DrawerClose render={<Button className="w-full" variant="outline" />}>
            Cancel
          </DrawerClose>
        </DrawerFooter>
      </DrawerPopup>
    </Drawer>
  );
}
```
