shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Multi Section
Sheet with Action Buttons in Footer for React
A right-side task sheet with name, assignee and due date fields and Save Draft and Create Task buttons in the footer.
A new-task form whose two actions sit side by side in SheetFooter: Save Draft in the outline style and Create Task as the primary button. The footer stays at the bottom of the panel, so both actions are where people expect them.
Preview
Installation
FAQ
How are the two footer buttons styled?
Save Draft uses variant="outline" and Create Task the default variant, so the main action stands out. Both sit in SheetFooter.
Which fields does the task form have?
Task Name, Assignee and Due Date. Due Date uses type="date", so the browser shows its own date picker. Assignee is a text input here; a Combobox of team members fits better in a real app.
Do the buttons save anything?
Not in this demo: neither has a handler. Save the draft without closing, then create the task and close the sheet by controlling its open state:
Pass open to Sheet; onOpenChange receives the next boolean.
How does the footer stay at the bottom?
SheetFooter takes the free space above it with mt-auto, so it sits at the bottom of the panel however short the form is.
Related
- Sheet with Header, Content, and FooterA right-side sheet in three parts: a
- Create New Item SheetA right-side sheet for adding an item
- User Profile Edit SheetA right-side sheet for editing a username
- Standard DialogA share dialog with a read-only link, a
- Button with Text (Standard)The one filled action
- Standard CardA basic card with a title, a description