Drawer
A native modal dialog presented at the logical start, end or bottom edge.
When to use it. Use for a bounded details or filters task. It is not a draggable panel or a replacement for ordinary navigation.
Drawer primary example
How it works
-
<.drawer>edge selects start, end or bottom, not application state. Logical sides follow writing direction. Content scrolls within a bounded viewport; no gestures or focus manager are installed. -
package CSSPackage CSS adds the optional presentation only when its complete capability gate passes. Requires the Dialog capability set. Logical edge layout and safe-area spacing are CSS presentation; unsupported presentation retains a bounded native dialog. -
gallery onlyTheme switching, source copying, search, fixtures, and inspection controls on this page belong to the gallery only; :drawer does not ship them. -
application boundaryDialog and Drawer are modal; Alert Dialog adds consequence semantics and safe cancel focus. Popover is nonmodal; Dropdown Actions contains ordinary controls, not ARIA menus. Tooltip and Hover Card are supplemental only. Use ordinary links for destinations, buttons for actions and visible Help for required guidance. Interest invokers and interactive previews are deferred.
Examples use package semantic tokens in explicit light and dark scopes.
Accessibility and browser support
The title, description, focus entry, native containment, Escape and explicit Close follow Dialog. The named body supports keyboard scrolling; keep header and footer short.
| Feature | Locked-engine evidence | When missing |
|---|---|---|
| Native baseline | Reviewed in the locked Chromium, Firefox, and WebKit evidence matrix. | Always-visible ordinary content below remains available. Without script, native controls still work when their required platform features exist. Without CSS, native dialogs/popovers still need invocation; supplemental content is visible in flow. Without invokers or Popover, use the ordinary alternative. Without anchors use bounded default placement; without transitions or with reduced motion it snaps. No hover/coarse pointer retains the complete trigger or link. Forced colors preserves borders and focus; narrow/zoomed text wraps, RTL uses logical edges or supplemental flow. Replacing the subtree does not restore its open state or focus. |
| Progressive enhancement | The locked-engine evidence exercises the authored complete capability gate. | Always-visible ordinary content below remains available. Without script, native controls still work when their required platform features exist. Without CSS, native dialogs/popovers still need invocation; supplemental content is visible in flow. Without invokers or Popover, use the ordinary alternative. Without anchors use bounded default placement; without transitions or with reduced motion it snaps. No hover/coarse pointer retains the complete trigger or link. Forced colors preserves borders and focus; narrow/zoomed text wraps, RTL uses logical edges or supplemental flow. Replacing the subtree does not restore its open state or focus. |
| Exact fallback | The locked-engine matrix retains the documented native or static outcome. | Always-visible ordinary content below remains available. Without script, native controls still work when their required platform features exist. Without CSS, native dialogs/popovers still need invocation; supplemental content is visible in flow. Without invokers or Popover, use the ordinary alternative. Without anchors use bounded default placement; without transitions or with reduced motion it snaps. No hover/coarse pointer retains the complete trigger or link. Forced colors preserves borders and focus; narrow/zoomed text wraps, RTL uses logical edges or supplemental flow. Replacing the subtree does not restore its open state or focus. |
Ordinary alternative: complete information and controls
Read the complete manual and review preferences here without opening a surface. No data is saved or deleted.
Practical guidance, also available in the complete manual. Also available as plain text.
معلومات إضافية متاحة أيضًا في الدليل الكامل.
Required help stays visible. A real application must provide its complete task here or at an ordinary route, not only inside an overlay.
Application ownership and API
Applications own routes, authorization, CSRF, validation, persistence, loading, outcomes and replacement. Replacing an open subtree may close it and lose native focus; these examples do not restore it or synchronize state. No real operation is executed.
Choosing the related control. Dialog and Drawer are modal; Alert Dialog adds consequence semantics and safe cancel focus. Popover is nonmodal; Dropdown Actions contains ordinary controls, not ARIA menus. Tooltip and Hover Card are supplemental only. Use ordinary links for destinations, buttons for actions and visible Help for required guidance. Interest invokers and interactive previews are deferred.
Provenance
Catalogue identity overlays.drawer, adapted from
unscripted/ui commit bd8f403030c8d1f46804da6eda733fde7e908e63
under its MIT notice.
The documentation presentation is adapted locally; ShadcnUI's Phoenix API and native semantic contract remain authoritative.
Adapt Drawer presentation to a native modal with deterministic HEEX relationships, logical start/end/bottom edges, explicit focus and exit, bounded native body scrolling and ordinary route fallback without gestures or JavaScript.