Skip to content

Sheet

Download .md

A sheet slides a panel in from the edge of the screen, over a dimmed page, for filters or details that don’t need a new page.

  • Use it for filters on a list, and for a side panel with the details of one row.
  • Use a Dialog for a decision or a short form, and a page for a long flow.
  • On phones, open it from the bottom as a bottom sheet.
React
Vue
1234
  1. 1Overlay
  2. 2Panel from the edge
  3. 3Title
  4. 4Action

A header with a title and one sentence of description, the content, and a footer with the main action. The panel sits on popover with a border on its inner edge and no radius on the edge that touches the screen, over the overlay token.

Side Use it for
right (default) Filters and details on the web.
bottom Filters and actions on phones.
left / top Rare; navigation menus use the Sidebar.
React Vue Flutter Type Default Use
side on SheetContent side on SheetContent side on showShadSheet text right The edge it slides in from.
open / onOpenChange v-model:open showShadSheet boolean false Opens it from code.
SheetTitle, SheetDescription SheetTitle, SheetDescription title, description text none Names the panel.
SheetFooter SheetFooter actions element none The main action.
import { useId } from "react"
import { Button } from "@/components/ui/button"
import { Checkbox } from "@/components/ui/checkbox"
import { Label } from "@/components/ui/label"
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"
const statuses = ["Terbit", "Menunggu", "Ditolak"]
export default function SheetDemo() {
const id = useId()
return (
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>Filter</SheetTrigger>
<SheetContent side="right">
<SheetHeader>
<SheetTitle>Filter rilis</SheetTitle>
<SheetDescription>Tampilkan rilis dengan status yang kamu pilih.</SheetDescription>
</SheetHeader>
<div className="grid gap-3 px-4">
{statuses.map((status) => (
<div key={status} className="flex items-center gap-2">
<Checkbox id={`${id}-${status}`} />
<Label htmlFor={`${id}-${status}`}>{status}</Label>
</div>
))}
</div>
<SheetFooter>
<SheetClose render={<Button />}>Terapkan</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/sheet.json
  • It is a dialog named by its title; the focus moves into it and back to the trigger when it closes.
  • Escape and the close button close it.
  • The page behind it can’t be reached until it closes.