Search 71 components and 72 controllers by name, category or description.
Side Panel
Nestable in-flow side panel for navigation, filters and workspace tools
Panel and inset
The panel shrinks to zero width and the inset takes the space it frees. Unlike hw:sidebar it stays in the document flow, never becomes an overlay on mobile, and can be nested.
Overview
The panel shrinks to zero width and the inset takes the space it frees — nothing leaves
the document flow, nothing becomes an overlay. That is the fundamental difference from
hw:sidebar.
On collapse the panel content gets inert immediately, so links and controls
inside it leave the tab order before the animation has even finished.
<hw:side-panel name="project-navigation" width="15rem" class="h-full">
<hw:side-panel.panel>
<nav aria-label="Project" class="space-y-1 p-3 text-sm">
<p class="px-2 pb-2 text-xs font-medium uppercase tracking-wider text-muted-foreground">Project</p>
@foreach (['Overview', 'Milestones', 'Deployments', 'Members', 'Settings'] as $index => $item)
<a
href="#"
@class([
'block rounded-md px-2 py-1.5 hover:bg-muted',
'bg-muted font-medium text-foreground' => $index === 0,
'text-muted-foreground' => $index !== 0,
])
>{{ $item }}</a>
@endforeach
</nav>
</hw:side-panel.panel>
<hw:side-panel.inset>
<hw:side-panel.trigger />
<div class="space-y-3 p-5 text-sm leading-7 text-muted-foreground">
<h3 class="text-base font-semibold text-foreground">Overview</h3>
<p>
The panel shrinks to zero width and the inset takes the space it frees — nothing leaves
the document flow, nothing becomes an overlay. That is the fundamental difference from
<code>hw:sidebar</code>.
</p>
<p>
On collapse the panel content gets <code>inert</code> immediately, so links and controls
inside it leave the tab order before the animation has even finished.
</p>
</div>
</hw:side-panel.inset>
</hw:side-panel>
Right side
side="right" moves the panel to the opposite edge and the trigger follows. The position and the icon direction come from the preset, not from a prop.
Editor
With side="right" the panel moves to the opposite edge and the trigger
follows — the position and the icon direction come from the preset, not from a prop.
The markup order does not change: panel then inset, exactly as on the left — the flip is flex-direction.
<hw:side-panel name="inspector" side="right" width="14rem" class="h-full">
<hw:side-panel.panel>
<div class="space-y-4 p-4 text-sm">
<p class="text-xs font-medium uppercase tracking-wider text-muted-foreground">Inspector</p>
<div class="space-y-1">
<p class="text-muted-foreground">Status</p>
<hw:badge variant="secondary">Draft</hw:badge>
</div>
<div class="space-y-1">
<p class="text-muted-foreground">Last edited</p>
<p class="font-medium">3 minutes ago</p>
</div>
</div>
</hw:side-panel.panel>
<hw:side-panel.inset>
<hw:side-panel.trigger label="Toggle inspector" />
<div class="space-y-3 p-5 text-sm leading-7 text-muted-foreground">
<h3 class="text-base font-semibold text-foreground">Editor</h3>
<p>
With <code>side="right"</code> the panel moves to the opposite edge and the trigger
follows — the position and the icon direction come from the preset, not from a prop.
</p>
<p>The markup order does not change: panel then inset, exactly as on the left — the flip is <code>flex-direction</code>.</p>
</div>
</hw:side-panel.inset>
</hw:side-panel>
Cookie persistence
Each panel isolates its own cookie from its name — here side_panel_saved-filters_state. The server reads the cookie before rendering, so the first frame already has the right state and nothing jumps. Collapse both, reload, and compare.
Toggle and reload: the state comes back as it was, and already on the first frame — the server reads the cookie before rendering.
The same gesture writes no cookie here: a reload gives back the initial state.
<hw:side-panel name="saved-filters" width="12rem" class="h-full">
<hw:side-panel.panel>
<div class="p-4 text-sm">
<p class="font-medium">Persists</p>
<p class="mt-1 text-xs text-muted-foreground">cookie <code>side_panel_saved-filters_state</code></p>
</div>
</hw:side-panel.panel>
<hw:side-panel.inset>
<hw:side-panel.trigger />
<p class="p-5 text-sm leading-7 text-muted-foreground">
Toggle and reload: the state comes back as it was, and already on the first frame —
the server reads the cookie before rendering.
</p>
</hw:side-panel.inset>
</hw:side-panel>
<hw:side-panel name="scratch" :persist="false" width="12rem" class="h-full">
<hw:side-panel.panel>
<div class="p-4 text-sm">
<p class="font-medium">Does not persist</p>
<p class="mt-1 text-xs text-muted-foreground"><code>:persist="false"</code></p>
</div>
</hw:side-panel.panel>
<hw:side-panel.inset>
<hw:side-panel.trigger />
<p class="p-5 text-sm leading-7 text-muted-foreground">
The same gesture writes no cookie here: a reload gives back the initial state.
</p>
</hw:side-panel.inset>
</hw:side-panel>
Nesting
Each controller only touches its own targets, so nested panels keep independent state and cookies. A Side Panel can also live inside a hw:sidebar without sharing its state or its overlay behaviour.
Workspace
Two independent panels: toggle the inner one, then the outer one — each keeps its own state and its own cookie.
<hw:side-panel name="workspace" width="17rem" class="h-full">
<hw:side-panel.panel>
{{-- A Side Panel inside another one's panel: each controller only sees its own
targets, so the two states and cookies never mix. --}}
<hw:side-panel name="workspace-filters" width="8rem" class="h-full">
<hw:side-panel.panel>
<div class="space-y-2 p-3 text-xs">
<p class="font-medium uppercase tracking-wider text-muted-foreground">Filters</p>
<p class="text-muted-foreground">Open</p>
<p class="text-muted-foreground">Mine</p>
</div>
</hw:side-panel.panel>
<hw:side-panel.inset>
<hw:side-panel.trigger label="Toggle filters" />
<div class="space-y-2 p-3 text-sm">
<p class="text-xs font-medium uppercase tracking-wider text-muted-foreground">Results</p>
<p class="text-muted-foreground">18 items</p>
</div>
</hw:side-panel.inset>
</hw:side-panel>
</hw:side-panel.panel>
<hw:side-panel.inset>
<hw:side-panel.trigger label="Toggle workspace" />
<div class="space-y-3 p-5 text-sm leading-7 text-muted-foreground">
<h3 class="text-base font-semibold text-foreground">Workspace</h3>
<p>
Two independent panels: toggle the inner one, then the outer one — each keeps its own
state and its own cookie.
</p>
</div>
</hw:side-panel.inset>
</hw:side-panel>
A keyboard shortcut by composition
The component deliberately ships no shortcut: a page can hold several panels, and a package-owned binding would be ambiguous. Compose the hotkey controller on the trigger instead — press o to toggle.
On this page
Installation
Configuration
Document
Press o anywhere on the page to toggle this panel. The shortcut is ignored while the focus sits in a text field.
<hw:side-panel name="docs-outline" width="13rem" class="h-full">
<hw:side-panel.panel>
<div class="space-y-1 p-3 text-sm">
<p class="px-2 pb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground">On this page</p>
<p class="rounded-md px-2 py-1 text-muted-foreground">Installation</p>
<p class="rounded-md px-2 py-1 text-muted-foreground">Configuration</p>
</div>
</hw:side-panel.panel>
<hw:side-panel.inset>
{{-- The component ships no shortcut: a page can hold several panels, so a
package-owned binding would be ambiguous. Compose hotkey on the trigger. --}}
<hw:side-panel.trigger
data-controller="hotkey"
data-action="keydown.o@window->hotkey#click"
/>
<div class="space-y-3 p-5 text-sm leading-7 text-muted-foreground">
<h3 class="text-base font-semibold text-foreground">Document</h3>
<p>
Press <hw:kbd>o</hw:kbd> anywhere on the page to toggle this panel. The shortcut is
ignored while the focus sits in a text field.
</p>
</div>
</hw:side-panel.inset>
</hw:side-panel>
Explicit initial state
ConceptualWithout default-open the component reads the cookie and falls back to expanded. Passing the value explicitly ignores the cookie — useful for a page that must always start the same way.
Resolution order: an explicit default-open, then the
side_panel_<name>_state cookie, then expanded.
Before Turbo Drive renders a new body, the controller copies the live state onto the incoming markup — so a response prepared before the last toggle cannot restore stale state.
{{-- Ignores the cookie and always starts collapsed --}}
<hw:side-panel name="tools" :default-open="false">
…
</hw:side-panel>