Figma UI kit
Overlays

Panels and drawers

v1.2.1

Inspect or edit a record beside the page without leaving it.

Quick usage

Import the shared component; never copy its markup into a feature. The Web TSX tab beside the live stage has a complete, working example.

import Drawer from '@/shared/components/Drawer';

Live stage and code

The live component and its controls on the left, the code on the right; change a control and the code follows: Web TSX (the component in a working example), Tailwind and HTML (the markup it renders, with its data attributes), React Native, SwiftUI and Jetpack Compose. The header theme switch drives every stage.

Props

Read from the component's source when the docs build: names and defaults from its signature, types and descriptions from its JSDoc. A blank type means the prop has no JSDoc yet.

PropTypeDefaultDescription
openboolean--
titlestring--
onClose() => void--
footerReact.ReactNodenullButtons, primary last.
containedbooleanfalse-
children---

Source: frontend/src/shared/components/Drawer/Drawer.js

DOM contract

What the rendered element carries: the data attributes its styles key on, its roles and ARIA, its focus style, and whether its stylesheet draws the 44px hit boundary. Also read from the source.

Data attributesdata-containeddata-ds
RolesNative element semantics only
ARIAaria-label
FocusNo :focus-visible rule of its own
44px hit boundaryNot a pressable root

Accessibility and touch

Footer actions are md 32px.

Panels

Visible height 28px. The ::after boundary adds 8px above and below, so a gloved finger lands on a 44px target while the row keeps its density.

Do and avoid

Do
CancelSave
Do: dock the footer on the drawer’s own rung with a 1px top border.
Avoid
CancelSave
Avoid: a chrome-coloured footer. It reads as a hole through the panel.

Rules and constraints

Use it for

  • Details, logs, the feedback panel.

Avoid

  • Never absolute positioning or a hardcoded body height.

Constraints

  • A three-part flex column: header, a scrolling body, a docked footer.
  • The header and footer carry the panel's own --bg-elevated, never chrome.

More in Overlays