Search 71 components and 72 controllers by name, category or description.
Drawer
Directional drawer with focus management and optional reusable Turbo Frame host for stacked instances
Directions
direction is physical — up, right, down, left — and does not mirror in RTL. Side drawers default to 75vw capped at 24rem; vertical ones size to their content.
direction="down"
Escape, the backdrop and drawer.close all dismiss it.
75vw capped at 24rem; vertical ones size to their content.
direction="up"
Escape, the backdrop and drawer.close all dismiss it.
75vw capped at 24rem; vertical ones size to their content.
direction="left"
Escape, the backdrop and drawer.close all dismiss it.
75vw capped at 24rem; vertical ones size to their content.
direction="right"
Escape, the backdrop and drawer.close all dismiss it.
75vw capped at 24rem; vertical ones size to their content.
{{-- direction is physical and does not mirror in RTL: up, right, down, left. --}}
@foreach (['down' => 'From the bottom', 'up' => 'From the top', 'left' => 'From the left', 'right' => 'From the right'] as $direction => $label)
<hw:drawer :direction="$direction">
<hw:drawer.trigger variant="outline">{{ $label }}</hw:drawer.trigger>
<hw:drawer.content>
<hw:drawer.header>
<hw:drawer.title>direction="{{ $direction }}"</hw:drawer.title>
<hw:drawer.description>Escape, the backdrop and drawer.close all dismiss it.</hw:drawer.description>
</hw:drawer.header>
<div class="p-4 text-sm text-muted-foreground">
Side drawers default to <code>75vw</code> capped at <code>24rem</code>; vertical ones size to their content.
</div>
<hw:drawer.footer>
<hw:drawer.close variant="outline">Close</hw:drawer.close>
</hw:drawer.footer>
</hw:drawer.content>
</hw:drawer>
@endforeach
Size, dismissal and focus
size takes any CSS length. Turning off close-on-escape and close-on-click-outside leaves drawer.close as the only way out — deliberate, and worth using sparingly.
size="30rem"
Overrides the 75vw/24rem default for side drawers.
Escape and backdrop disabled
For a step the user should not leave by accident. Use it sparingly.
:backdrop="false" motion="none"
initial-focus takes auto, dialog, first-focusable or none.
{{-- size takes any CSS length and lands on the drawer's width/height variable. --}}
<hw:drawer direction="right" size="30rem">
<hw:drawer.trigger variant="outline">Wider panel</hw:drawer.trigger>
<hw:drawer.content>
<hw:drawer.header>
<hw:drawer.title>size="30rem"</hw:drawer.title>
<hw:drawer.description>Overrides the 75vw/24rem default for side drawers.</hw:drawer.description>
</hw:drawer.header>
<hw:drawer.footer>
<hw:drawer.close variant="outline">Close</hw:drawer.close>
</hw:drawer.footer>
</hw:drawer.content>
</hw:drawer>
{{-- A drawer that only its own close button can dismiss. --}}
<hw:drawer direction="right" :close-on-escape="false" :close-on-click-outside="false">
<hw:drawer.trigger variant="outline">Deliberate dismissal</hw:drawer.trigger>
<hw:drawer.content>
<hw:drawer.header>
<hw:drawer.title>Escape and backdrop disabled</hw:drawer.title>
<hw:drawer.description>For a step the user should not leave by accident. Use it sparingly.</hw:drawer.description>
</hw:drawer.header>
<hw:drawer.footer>
<hw:drawer.close>Understood</hw:drawer.close>
</hw:drawer.footer>
</hw:drawer.content>
</hw:drawer>
{{-- No backdrop, no motion, focus left where it was. --}}
<hw:drawer direction="down" :backdrop="false" motion="none" initial-focus="none">
<hw:drawer.trigger variant="outline">Bare and static</hw:drawer.trigger>
<hw:drawer.content>
<hw:drawer.header>
<hw:drawer.title>:backdrop="false" motion="none"</hw:drawer.title>
<hw:drawer.description>initial-focus takes auto, dialog, first-focusable or none.</hw:drawer.description>
</hw:drawer.header>
<hw:drawer.footer>
<hw:drawer.close variant="outline">Close</hw:drawer.close>
</hw:drawer.footer>
</hw:drawer.content>
</hw:drawer>