Drawer

A drawer slides in from the right side of the screen, appearing over the main content. It displays additional information while keeping the underlying page and its navigation visible and active.

Figma logo The guideline content on this page is synced with Figma and can be used as a source of truth. Open in Figma


Anatomy

  1. Title
  2. Scrim
  3. Container
  4. Close button
  5. Button section
Drawer anatomy diagram showing: 1 — title, 2 — scrim, 3 — container, 4 — close button, 5 — button section

Usage

You should use a drawer (also known as a side panel or sidebar) when you need to display additional information or controls without navigating away from the main view. Drawers are ideal for tasks that require context from the main page, providing a more efficient workflow for the user.

Container

The only required element for drawers is the container, as they can hold diverse content. A header, which includes a title and a close button, is provided as a standard element.

The easiest way to use this component is to use the slot functionality. Let us know if you have any questions about this.

A drawer open over a Spiris application, showing supplementary content without leaving the main view

Dismissing

Drawers can be closed in different ways:

  • Click on the close button
  • Click on one of the buttons in the footer
  • Click on the scrim
A drawer with its close button, footer buttons, and surrounding scrim highlighted as the three ways to dismiss it

Accessibility

Keyboard interaction

All components should be reachable via TAB and SHIFT+TAB keys.


Best practices

A single drawer open over the page

Do

Only use one drawer per interaction.

Two drawers stacked on top of each other

Don't

Avoid stacking drawers.


Specs

Drawer specification measurements: 24px header and body padding, 16px footer padding, 24px button gap, 16px container radius

Developer reference

The following sections describe supported functionality that is not part of the Figma design specification.


Drawer size

Drawers/sliders have 3 optional sizes:

  • 75% of your viewport (.drawer-lg)
  • 50% of your viewport (is the default size of the drawers or .drawer-md)
  • 520px wide (.drawer-sm)

Add a .drawer-backdrop element to dim the page behind the drawer. Toggle the .show class on both the drawer and the backdrop to open them together.

For this component you need JavaScript! We recommend creating your own script to open and close the drawer/slider. If you need help just contact us.

Demo page! Here you can find a demo page where you can test a drawer/slider, together with a navigation and a text panel.


Alternatives