Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Sheet examples · Multi Section

Sheet with Header, Content, and Footer for React

A right-side sheet in three parts: a header, a body that takes the free height, and a footer with Cancel and Continue.

Framework
UI library

The three parts a sheet usually has: SheetHeader with the title, a body with flex-1 that takes the free height, and SheetFooter with the actions. Cancel is a SheetClose; Continue is yours to wire up.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How is the sheet split into header, body and footer?

SheetContent is a flex column. SheetHeader comes first, the body div has flex-1 so it fills the space in between, and SheetFooter sits last.

How does Cancel close the sheet?

It's wrapped in SheetClose, which dismisses the sheet when pressed. Pass your button to SheetClose with render.

Does Continue do anything?

Not yet: it's a plain Button. Run your next step from it, and close the sheet by controlling its open state if that step leaves the panel: Pass open to Sheet; onOpenChange receives the next boolean.

What if the body gets long?

Add overflow-y-auto to the body next to flex-1. The body then scrolls while the header and footer stay in place.

How does Open Sheet open it?

The button labeled Open Sheet is the trigger, and its text is the accessible name. The Button goes in the render prop of SheetTrigger, and the label stays its child.

What does the sheet announce?

SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. It reads Complete Your Profile, with Fill in your information to get started as the description.