# V drawer 10

> 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-10).

- Page, with a live preview: https://shadcn.exchange/r/cnippet/v-drawer-10
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/cnippet/v-drawer-10-light-ee3a846c4e11a0fc.png
- Registry item: https://ui.cnippet.dev/r/v-drawer-10.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-10.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-10.tsx`

```tsx
"use client";

import { PencilIcon } from "lucide-react";
import { useState } from "react";
import { Button } from "@/registry/default/ui/button";
import {
  Drawer,
  DrawerClose,
  DrawerFooter,
  DrawerHeader,
  DrawerPanel,
  DrawerPopup,
  DrawerTitle,
  DrawerTrigger,
} from "@/registry/default/ui/drawer";
import {
  Field,
  FieldDescription,
  FieldLabel,
} from "@/registry/default/ui/field";
import { Input } from "@/registry/default/ui/input";

export default function Component() {
  const [saved, setSaved] = useState(false);

  function handleSave() {
    setSaved(true);
    setTimeout(() => setSaved(false), 1500);
  }

  return (
    <Drawer position="bottom">
      <DrawerTrigger render={<Button variant="outline" />}>
        <PencilIcon className="size-4" />
        Edit profile
      </DrawerTrigger>
      <DrawerPopup showBar variant="inset">
        <DrawerHeader>
          <DrawerTitle>Edit profile</DrawerTitle>
        </DrawerHeader>
        <DrawerPanel>
          <div className="flex flex-col gap-4">
            <div className="flex gap-3">
              <Field className="flex-1">
                <FieldLabel>First name</FieldLabel>
                <Input defaultValue="Alex" placeholder="First name" />
              </Field>
              <Field className="flex-1">
                <FieldLabel>Last name</FieldLabel>
                <Input defaultValue="Morgan" placeholder="Last name" />
              </Field>
            </div>
            <Field>
              <FieldLabel>Email</FieldLabel>
              <Input
                defaultValue="alex@example.com"
                placeholder="Email"
                type="email"
              />
              <FieldDescription>
                Used for notifications and sign-in.
              </FieldDescription>
            </Field>
            <Field>
              <FieldLabel>Bio</FieldLabel>
              <Input
                defaultValue="Product designer at Acme Inc."
                placeholder="Short bio"
              />
            </Field>
          </div>
        </DrawerPanel>
        <DrawerFooter>
          <Button className="flex-1" onClick={handleSave}>
            {saved ? "Saved!" : "Save changes"}
          </Button>
          <DrawerClose render={<Button className="flex-1" variant="outline" />}>
            Cancel
          </DrawerClose>
        </DrawerFooter>
      </DrawerPopup>
    </Drawer>
  );
}
```
