Example#
Get a quote
One working day for a reply.
Tell me what you are making.
Usage#
Use a drawer for a task that needs more room than a dialog but should keep the page in view: the quote form, filters, the phone navigation. It has the Dialog's parts and keyboard, sliding from a side.
- Sides.
sideisend(default),start,bottomortop, or responsive such as{ base: "bottom", md: "end" }. - Sticky edges. The header with its close key stays at the top, and
DrawerFooter stickykeeps the form's Send in reach; only the body scrolls. - No drag to dismiss. The close key, Escape and the scrim cover it, for every input method.
- A single decision is a
Dialog. Content people link to or bookmark is a page.
Anatomy#
Get a quote
One working day for a reply.
Tell me what you are making.
- PanelRaised surface from its side, up to 32 rem wide.
.mk-drawer-popup - TitleIn the sticky header with the close key.
.mk-drawer-title - BodyThe only part that scrolls.
.mk-drawer-body - FooterSticky: the main action stays in reach.
.mk-drawer-footer
Volume#
Reading layer: identical at every volume.
Quiet
Get a quote
One working day for a reply.
Tell me what you are making.
Studio
Get a quote
One working day for a reply.
Tell me what you are making.
Press
Get a quote
One working day for a reply.
Tell me what you are making.
Rave
Get a quote
One working day for a reply.
Tell me what you are making.
Content#
- The title names the task: "Get a quote".
- The description sets expectations: "One working day for a reply."
- The main key repeats the task's verb: "Send", with "Not now" to leave.
Do and don't#
Do
Get a quote
One working day for a reply.
Tell me what you are making.
Don't
A drawer whose Send key scrolls away under a long form.
Accessibility#
- Same keyboard as Dialog. No drag to dismiss: the close key, Escape and the backdrop cover it.
- It slides in on transforms only; reduced motion fades.
| Keys | What happens |
|---|---|
| EnterorSpace on the trigger | Opens the drawer; focus moves inside |
| TaborShift+Tab | Cycle inside the drawer (focus is trapped) |
| Escape | Closes it; focus returns to the trigger |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-text | --mk-surface-raised | ui | not in this look | not in this look |
--mk-text-2 | --mk-surface-raised | ui | not in this look | not in this look |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | none | |
defaultOpen | boolean | none | |
onOpenChange | ((open: boolean) => void) | none | |
alert | boolean | none | `role="alertdialog"`; an outside press does not close it. |
children required | React.ReactNode | none |
Tokens#
System tokens (30)
--mk-border--mk-dur-drawer-in--mk-dur-drawer-out--mk-dur-reduced--mk-ease-out--mk-font-display--mk-font-text--mk-radius-plate--mk-rule-soft--mk-scrim--mk-shadow-pop--mk-space-3--mk-space-4--mk-space-5--mk-space-6--mk-surface-raised--mk-text--mk-text-2--mk-track-head-card--mk-type-body-ui-leading--mk-type-body-ui-size--mk-type-body-ui-weight--mk-type-head-card-leading--mk-type-head-card-size--mk-type-meta-leading--mk-type-meta-size--mk-type-meta-weight--mk-wd-head-card--mk-wght-head-card--mk-z-overlay
Its own properties (15)
--mk-drawer-be--mk-drawer-bs--mk-drawer-close-room--mk-drawer-from--mk-drawer-h--mk-drawer-ie--mk-drawer-is--mk-drawer-max-h--mk-drawer-pad--mk-drawer-radius--mk-drawer-rule-be--mk-drawer-rule-bs--mk-drawer-rule-ie--mk-drawer-rule-is--mk-drawer-w
Changelog#
Arrived in 0.1.0.
- The reading layer's controls, overlays, forms and visitor prefs (P2-T1 to P2-T5): every Button is the comic hit key, with IconButton, Link and Tooltip; Input, Textarea, Select, Checkbox and CheckboxGroup, Radio and RadioGroup, Switch, Slider with the ruler, RulerReadout and SegmentedControl; Dialog, Drawer, NavSheet, Tabs, Disclosure, Faq and faqJsonLd on Base UI 1.9 where the platform falls short; Field, Fieldset, Form with the site's inline validation, ErrorSummary, Callout, Honeypot, FormTimestamp and QuoteForm; PrefsScript under 1 KB, usePref and setPref with cross-tab sync, ThemeToggle and the visitor VolumeDial; VisuallyHidden.