Sheet
A panel that slides in from an edge.
Left out of Accessible first Only dialogs separate from the page here, with a dimmed page and a border. A panel sliding in from an edge adds a layer the scheme does not use. Use instead: Dialog, Collapsible
See it live
npm run storybookWhen to use it
- Use it when: Filters, details or a secondary form while the page stays in view.
- Not when: A blocking decision (dialog), or a tiny confirmation.
Instead:
How Accessible first uses it
Words
- Use common words. Explain any term you must use.
- One idea per sentence. Put the action first.
- Never blame the person.
- Use: Continue, Change, Start, You. Avoid: Invalid, Utilise, Submit, Error code.
The labels components use, from the voice tokens:
content.action.commit: Continuecontent.action.cancel: Go backcontent.action.destroy: Deletecontent.action.retry: Try againcontent.action.empty-action: Start a new application
See Voice and tone for the whole voice.
Accessibility and keyboard
| Keyboard | What happens | Not |
|---|---|---|
| undefined | Escape closes it. | undefined |
Test before you ship:
- It behaves as a dialog: named, focus moves in and back. undefined
Use it in code
npx open-ds add sheet
The component reads only component keys and semantic tokens, so it follows the brand and mode on <html>.
Tokens it reads
Sheet reads 19 tokens of its own, each an alias of a semantic token. Each row is one part: its own token, the semantic it aliases, and the value it ends at. Change a semantic and every component that reads it follows; override one of Sheet's tokens to change Sheet alone.
Accessible first decides what changes when you switch theme. Here a switch changes colors only, so the marked rows differ between light and dark; everything else holds steady.
| Part | Its token and the semantic it aliases | Value |
|---|---|---|
| Shared | ||
| Transition panels duration | component.transition.panels-durationmotion.duration.panelsvar(--transition-panels-duration) | duration.moderate:200ms |
| Overlay | ||
| Fill Changes with theme | component.sheet.overlay.backgroundcolor.surface.scrimvar(--sheet-overlay-background) | Lightblack.light.scrim:#0000008CDarkblack.dark.scrim:#000000B3 |
| Content | ||
| Gap | component.sheet.content.gapspace.gap.groupvar(--sheet-content-gap) | space.32:2rem |
| Fill Changes with theme | component.sheet.content.backgroundcolor.surface.canvasvar(--sheet-content-background) | Lightgray.light.50:#F7F7F7Darkgray.dark.0:#0A0A0A |
| Shadow | component.sheet.content.shadowelevation.overlayvar(--sheet-content-shadow) | shadow.none |
| Sheet | ||
| Corner | component.sheet.radiusradius.badgevar(--sheet-radius) | radius.4:0.25rem |
| Focus ring offset Changes with theme | component.sheet.focus-ring-offsetcolor.surface.canvasvar(--sheet-focus-ring-offset) | Lightgray.light.50:#F7F7F7Darkgray.dark.0:#0A0A0A |
| Focus on focus | component.sheet.focusborder-width.focusvar(--sheet-focus) | border-width.3:3px |
| Focus ring focus Changes with theme on focus | component.sheet.focus-ring-focuscolor.border.focusvar(--sheet-focus-ring-focus) | Lightblue.light.600:#0B4FC0Darkblue.dark.600:#8AB4F8 |
| Background open Changes with theme when open | component.sheet.background-opencolor.action.secondaryvar(--sheet-background-open) | Lightgray.light.0:#FFFFFFDarkgray.dark.50:#141414 |
| Icon size | component.sheet.icon-sizesize.iconvar(--sheet-icon-size) | size.20:1.25rem |
| Header | ||
| Gap | component.sheet.header.gapcomponent-spacing-map.x2var(--sheet-header-gap) | space.8:0.5rem |
| Padding | component.sheet.header.paddingspace.inset.containervar(--sheet-header-padding) | space.24:1.5rem |
| Footer | ||
| Gap | component.sheet.footer.gapspace.gap.defaultvar(--sheet-footer-gap) | space.16:1rem |
| Padding | component.sheet.footer.paddingspace.inset.containervar(--sheet-footer-padding) | space.24:1.5rem |
| Title | ||
| Weight | component.sheet.title.font-weighttype.title.font-weightvar(--sheet-title-font-weight) | font.weight.700:700 |
| Text Changes with theme | component.sheet.title.labelcolor.text.primaryvar(--sheet-title-label) | Lightgray.light.900:#141414Darkgray.dark.900:#F7F7F7 |
| Description | ||
| Text size | component.sheet.description.font-sizetype.body.font-sizevar(--sheet-description-font-size) | font.size.19:1.1875rem |
| Text Changes with theme | component.sheet.description.labelcolor.text.mutedvar(--sheet-description-label) | Lightgray.light.500:#595959Darkgray.dark.500:#949494 |
| From the system | ||
| Edge Changes with theme | color.border.default straight from the system, through --border | Lightgray.light.200 · #D6D6D6Darkgray.dark.100 · #222222 |