Selector: mui-sheet
Import
import { Sheet } from '@mushilu-san/ui/feedback';
PreviewCodeOverview
Sheet is a modal panel anchored to one edge, set with side: start, end, top or bottom. left and right are physical aliases. open is a two-way model.
It traps focus while open, closes on Escape and on the backdrop unless those are turned off, and returns focus to the trigger when it closes.
When to use
- Filters, details or a settings panel that should not leave the current page.
- A side panel for editing an item from a list.
When not to use
- A short confirmation. Use an alert dialog. Use Alert dialog instead.
- A bottom panel on a phone that a thumb should reach. Use a bottom sheet. Use Bottom sheet instead.
Guidelines
Do
- Give the sheet a heading that says what it is for.
- Put the primary action in a footer slot.
Don't
- Do not nest sheets on top of each other.
Accessibility
Roles and attributes
Keyboard
- Focus returns to the element that opened the sheet. Give the close button a clear label.
API
Sheet
Selector: mui-sheet
CSS parts
::part(body)::part(close)::part(header)::part(panel)::part(root)::part(surface)::part(title)
Tokens
--mui-color-surface-raised--mui-color-border--mui-shadow-5--mui-z-modal--mui-color-focus-ring