Component guideEditable source

Sheet

A modal panel that enters from an edge of the viewport.

Original component docs
On this page6 sectionsBack to top

Use Sheet for navigation, filters, or an auxiliary task needing more room than a popover. It uses dialog semantics and includes a portal and backdrop. Use Drawer when drawer interaction fits the task better.

Live preview
Loading preview...

#Installation

Complete the base setup. For manual installation:

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

The profile form in the live preview additionally uses Input and Label. Install them before copying the Code example:

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

#Usage

import { Button } from "@/components/ui/button";
import {
  Sheet,
  SheetTrigger,
  SheetContent,
  SheetHeader,
  SheetTitle,
  SheetDescription,
} from "@/components/ui/sheet";

export default function WorkspacePanel() {
  return (
    <Sheet>
      <SheetTrigger render={<Button variant="outline" />}>Workspace details</SheetTrigger>
      <SheetContent side="right">
        <SheetHeader>
          <SheetTitle>Workspace details</SheetTitle>
          <SheetDescription>Settings shared with all project members.</SheetDescription>
        </SheetHeader>
        <div className="p-4">
          <p>Connect your application settings here.</p>
        </div>
      </SheetContent>
    </Sheet>
  );
}

#API reference

Prop / partPurposeDefault
Sheet.open / onOpenChangeControlled visibilityUncontrolled
Sheet.defaultOpenInitial visibilityfalse
SheetTrigger.render / SheetClose.renderButton compositionPrimitive button
SheetContent.sidetop, right, bottom, leftright
SheetContent.showCloseButtonBuilt-in close controltrue
SheetContent.initialFocus / finalFocusFocus destinationsBase UI behavior

#Accessibility

Provide SheetTitle and a useful description. Keep the close control reachable when content scrolls. Test Escape and focus return. Avoid essential actions below an unreachable mobile viewport. Removing the default close button requires another clear dismissal action.

Every side is bounded by the viewport height. For a persistent header and footer, put long body content in an overflow-y-auto container, as in the Side example.

#Examples

#Side

Loading preview...