Draft. Ported from control-center’s Sheet (commit
534414f, itself from shadcn-vue) and styled with Beehexa tokens. Not yet approved. It is in the registry so teams can try it; the API may still change before approval.
A sheet is a dialog that slides in from an edge of the window. The page stays behind it under a scrim, and nothing on the page can be used until the sheet closes.
When to use
- To edit one record without leaving a list, such as a store’s name and URL.
- To show the details of a row, such as an order, next to the list it came from.
- For a form too long for a dialog but too short for a page of its own.
When not to use
- To confirm an action. Use an alert dialog.
- For a short question or a few fields. Use a dialog.
- On phones, for a few choices people can swipe away. Use a drawer.
- For navigation that stays open. Use a sidebar.
Anatomy
| Part | Required | Notes |
|---|---|---|
| Scrim | Yes | color.surface.scrim over the page, at z-index.modal. |
| Panel | Yes | color.surface.overlay, elevation.shadow.modal, radius.modal on the two corners away from the edge. No border. |
| Header | Yes | SheetTitle (font.heading.small) and an optional SheetDescription (font.body.default, color.text.subtle). Padding space.modal. |
| Body | Yes | Your content. Give it space.modal at the sides; parts are space.modal.gap apart. |
| Footer | No | Actions, right-aligned, 8 px apart, primary action last (D10). |
| Close button | Yes, by default | A Subtle icon button at the top end, named by closeLabel. |
Side and width
- Right is the default. Use left only for content that belongs to the start of the page, such as filters for a list. Top and bottom sheets are rare; on phones use a drawer instead.
- Left and right sheets fill the window below
breakpoint.lg(layout.overlay.mobile) and are at mostlayout.overlay.defaultwide from it. For a short form, narrow it with a class such aslg:max-w-md. For wide data,lg:max-w-(--bh-layout-overlay-wide).
Behaviour
- Opens with a short slide and fade. Focus moves into the sheet and stays there.
- Closes with the close button, a Cancel button, Esc or a click on the scrim. Focus goes back to the button that opened it.
- If closing would lose unsaved changes, ask first with an alert dialog.
Tokens
color.surface.overlay, color.surface.scrim, color.border, color.text, color.text.subtle, elevation.shadow.modal, radius.modal, space.modal, space.modal.gap, z-index.modal, font.heading.small, font.body.default, layout.overlay.mobile, layout.overlay.default, border.width.default.