Skip to content

Drawer

The drawer slides in from left, right, or bottom over the page. Use for controlled visibility. Optional header chrome (title, subtext, leading icon) stays fixed while the main body scrolls; optional footer actions sit at the bottom.

Loading Code Block...

A minimal drawer: trigger button, controlled open state, and body content only (no header or footer). The drawer renders into a portal and opens over the entire document.

Loading Code Block...

Use side="left", side="right", or side="bottom". Use the dropdown in the interactive demo to cycle placements; the snippet below fixes right.

Loading Code Block...

When header includes a title, the header stays fixed, the default slot / children scrolls, and an optional footer stays pinned to the bottom.

Loading Code Block...

Use buttonGroup in both frameworks. The shape mirrors ButtonGroup (primaryButton, secondaryButton, tertiaryButton, type, layout), and each button object uses text for its caption. Tertiary actions are rendered when type: 'link'. Button size is mapped automatically (sm below the md breakpoint, otherwise md) in both frameworks.

Loading Code Block...
  • When the drawer opens, focus should move into the panel; restore focus to the trigger on close (your app or dialog primitive typically handles this).
  • Provide a clear title in header when the drawer represents a distinct task or page fragment.
  • For side="bottom" drawers, treat them like mobile sheets: keep primary actions reachable and avoid trapping keyboard users without an explicit close control (showClose).