Component referenceSource owned

Sheet

Extends the Dialog component to display content that complements the main content of the screen.

Upstream reference
On this page4 sectionsBack to top
Live preview
Loading preview...

#Installation

npx shadcn@latest add https://neobrutal-ui.andongmin.com/r/sheet.json

#Usage

import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
  Sheet,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from "@/components/ui/sheet";
<Sheet>
  <SheetTrigger asChild>
    <Button>Open</Button>
  </SheetTrigger>
  <SheetContent>
    <SheetHeader>
      <SheetTitle>Edit profile</SheetTitle>
      <SheetDescription>
        Make changes to your profile here. Click save when you&apos;re done.
      </SheetDescription>
    </SheetHeader>
    <form id="sheet-profile-form" className="grid flex-1 auto-rows-min gap-6 px-4">
      <div className="grid gap-3">
        <Label htmlFor="sheet-demo-name">Name</Label>
        <Input id="sheet-demo-name" name="name" defaultValue="Pedro Duarte" required />
      </div>
      <div className="grid gap-3">
        <Label htmlFor="sheet-demo-username">Username</Label>
        <Input
          id="sheet-demo-username"
          name="username"
          defaultValue="@andongmin94"
          required
        />
      </div>
    </form>
    <SheetFooter>
      <Button form="sheet-profile-form" type="submit">
        Save changes
      </Button>
      <SheetClose asChild>
        <Button type="button" variant="neutral">
          Close
        </Button>
      </SheetClose>
    </SheetFooter>
  </SheetContent>
</Sheet>

#Examples

#Side

Use the side property to <SheetContent /> to indicate the edge of the screen where the component will appear. The values can be top, right, bottom or left.


Loading preview...