On this page

Drawer

When to use a drawer, its parts, behaviour and tokens.

Draft. Ported from the shadcn-vue Drawer (registry style reka-nova, read 12 November 2026) 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 drawer is a dialog that slides in from an edge and can be swiped back to it. It is made for touch screens: a bottom drawer sits where a thumb can reach it.

When to use

  • On phones, for a short task: pick one of a few options, confirm a filter, read a short summary.
  • For the mobile version of a menu or a sheet when the content is short.

When not to use

  • On a desktop page, to edit a record. Use a sheet.
  • To confirm an action. Use an alert dialog.
  • For long forms. They are hard to fill in a panel that closes on a swipe. Use a page or a sheet.

Anatomy

Part Required Notes
Scrim Yes color.surface.scrim over the page, at z-index.modal.
Panel Yes color.surface.overlay (the mobile drawer surface), elevation.shadow.modal, radius.modal on the corners away from the edge. No border. At most 80% of the window high.
Grab bar Bottom drawer only drawer.handle.width (80 px) by size.track.default (4 px), radius.full, color.border.bold. It shows the drawer can be swiped; it is not a button.
Header Yes DrawerTitle (font.heading.small) and an optional DrawerDescription (font.body.default, color.text.subtle). Centred on phones, start-aligned from breakpoint.md. Padding space.modal.
Footer Yes A Cancel or Close button and the primary action, right-aligned, primary last (D10).

Behaviour

  • Swipe toward its edge to close. Swiping only part of the way lets it spring back.
  • Also closes with Esc, a click on the scrim, or a DrawerClose button. Focus goes back to the button that opened it.
  • snapPoints on Drawer stops it at set heights, such as half open and full.

Tokens

color.surface.overlay, color.surface.scrim, color.border, color.border.bold, color.text, color.text.subtle, elevation.shadow.modal, radius.modal, radius.full, space.modal, space.200, z-index.modal, drawer.handle.width, size.track.default, font.heading.small, font.body.default.

  • Sheet: the side panel for larger screens.