Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Sheet examples · Form

Create New Item Sheet for React

A right-side sheet for adding an item, with name, description and price fields and Cancel and Create buttons in the footer.

Framework
UI library

A create form in a right-side sheet: Item Name, Description and Price, with Cancel and Create side by side in SheetFooter. Cancel is a SheetClose, so it dismisses the panel; Create is yours to wire to the save.

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

Which fields does the item form have?

Item Name and Description are text inputs, and Price is type="number" with 0.00 as its placeholder. Each sits in a Field with its label.

How does Cancel close the sheet?

It's wrapped in SheetClose, which closes the sheet when pressed. Use the same part for any button that should dismiss the panel. Pass your button to SheetClose with render.

Does Create close the sheet?

No, it's a plain Button. Save the item, then close the sheet by controlling its open state: Pass open to Sheet; onOpenChange receives the next boolean.

How does Create New open the sheet?

The button labeled Create New 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 Create New Item, with Add a new item to your collection as the description.