Skip to main content

Drawer

Drawer is a temporary, focused region that supports a small, self-contained action, such as choosing an option, confirming a decision, or entering a few fields, without leaving the current screen. It's designed to briefly pause the primary flow, allow the completion of tasks and then return directly to the prior context.

Also known as: Flyout, Sheet
Salt package@salt-ds/core
Available since1.19.0
  • Users can resize a resizable drawer by dragging its inner edge.
  • Users can also resize it without dragging: they click the edge, then click the new position for it. A guide line shows the new position until the second click.
  • When the resize handle has focus, users can resize the drawer with the keyboard.
KeyFunction
Enter / Space
  • If focus is on the trigger element, this action activates the element and opens the drawer. Focus doesn't leave the drawer.
  • If focus is on close button, this action closes the drawer. Focus returns to the trigger element.
  • If focus is on a content element configured to close the drawer when activated, such as a Submit button, this action closes the drawer.
Tab
  • Tab moves focus through focusable content elements in the drawer. Focus doesn't leave the drawer.
Shift + Tab
  • This action moves focus to previous focusable content element in the drawer. Focus doesn't leave the drawer.
Escape
  • Escape closes the drawer and returns focus to the trigger element.
  • If the user is dragging or placing the edge of a resizable drawer, Escape cancels the resize instead and keeps the drawer open at its previous size.

When the resize handle of a resizable drawer has focus:

KeyFunction
Left arrow / Right arrow
  • For left and right drawers, moves the edge by a small step.
Up arrow / Down arrow
  • For top and bottom drawers, moves the edge by a small step.
Home
  • Shrinks the drawer to its minimum size.
End
  • Grows the drawer to its maximum size.
Enter
  • Shrinks the drawer to its minimum size, or restores its previous size.