Skip to the page
Tactile UI

Kit parts

Drawer

A panel that slides in from any edge of the window, on the native dialog. A face plate bolted to the frame, with a machined grip let into its inner edge to pull it shut by.

On this page
  1. Anatomy
  2. Variants
  3. States
  4. Props and options
  5. Usage notes
  6. Accessibility
  7. Related parts

Seats open in 11 days. Want one email that morning?

Anatomy

The browser’s dialog does the hard parts: the top layer, the backdrop, the inert page, the focus trap and the return of focus. The plate is the kit’s face, bolted to an edge (its corners are square where it meets the frame and round where it faces the page) and its shadow falls toward the page. The grip is a slot cut into the inner edge with two ribs standing in it.

Variants

  • From the right · the default
  • From the left
  • From the bottom
  • From the top
  • With a foot · one contrast key

States

  • Right
  • Left
  • Bottom
  • Top

Props and options

NameKindDescription
data-edgeattributeWhich edge it comes from. Right is the default.
data-drawer-open · data-drawer-closeattributeOn any element: opens that drawer; closes the one it is in, with an optional returnValue.
data-lockattributeA click on the scrim no longer closes it. Escape still does; intercept cancel to stop that too.
openDrawer(d) · closeDrawer(d, value)functionshowModal() and close(), safe to call when already in that state.
EscapekeyboardCloses it; focus returns to the key that opened it.
Tab · Shift TabkeyboardCycle inside it: the page behind is inert while it is open.

Usage notes

Open a drawer from any edge. Escape, the scrim, the close key or a drag on the grip put it away; focus goes back to the key you used.

Accessibility

  • Escape closes it.
  • The page behind stops scrolling while it is open, so a wheel or a swipe over the drawer never moves what is under it.
  • The slide is a transform and a fade of the scrim; with reduced motion the drawer simply appears and disappears.
  • Drawers do not open other drawers: a second layer of modal is a page.

Dialog

A decision that must be made now: a native dialog with a question, one sentence of consequence, a way back and the act.

Popover

A card hung from the key that opened it, with a printed leader running back to the key. Not modal: the page stays live around it.

Command palette

Every action and page behind one key: a modal plate whose entry line is a lit display, with the results printed below and the chosen one pressed in.