Search 71 components and 72 controllers by name, category or description.
Sidebar
Responsive app sidebar with collapse modes, mobile overlay and persisted state
Full structure
Every region at once, with collapsible="none" so the panel stays a plain <aside> and fits in this card. menu-button renders an anchor when it has href and a <button> otherwise.
Main content
sidebar.inset is the content area beside the panel.
{{-- collapsible="none" renders a plain <aside>: no fixed positioning, no state,
so the whole anatomy fits inside a bounded container. --}}
{{-- The preset gives the wrapper min-h-svh; min-h-0 lets it sit inside a card. --}}
<hw:sidebar.provider class="h-80 min-h-0 overflow-hidden rounded-lg border">
<hw:sidebar collapsible="none" class="h-full">
<hw:sidebar.header>
<hw:sidebar.brand href="#" label="Acme Cloud">
<span>Acme Cloud</span>
<x-slot:icon>
<hw:icon name="panel-left" />
</x-slot:icon>
</hw:sidebar.brand>
<hw:sidebar.input placeholder="Search…" />
</hw:sidebar.header>
<hw:sidebar.separator />
<hw:sidebar.content>
<hw:sidebar.group>
<hw:sidebar.group-label>Platform</hw:sidebar.group-label>
<hw:sidebar.group-action aria-label="Add project">
<x-lucide-plus class="size-4" />
</hw:sidebar.group-action>
<hw:sidebar.group-content>
<hw:sidebar.menu>
<hw:sidebar.menu-item>
<hw:sidebar.menu-button href="#" active>
<x-lucide-layout-dashboard class="size-4" />
<span>Dashboard</span>
</hw:sidebar.menu-button>
<hw:sidebar.menu-badge>12</hw:sidebar.menu-badge>
</hw:sidebar.menu-item>
<hw:sidebar.menu-item>
<hw:sidebar.menu-button href="#">
<x-lucide-folder class="size-4" />
<span>Projects</span>
</hw:sidebar.menu-button>
<hw:sidebar.menu-action show-on-hover aria-label="Create project">
<x-lucide-plus class="size-4" />
</hw:sidebar.menu-action>
<hw:sidebar.menu-sub>
<hw:sidebar.menu-sub-item>
<hw:sidebar.menu-sub-button href="#" active>Acme</hw:sidebar.menu-sub-button>
</hw:sidebar.menu-sub-item>
<hw:sidebar.menu-sub-item>
<hw:sidebar.menu-sub-button href="#">Northstar</hw:sidebar.menu-sub-button>
</hw:sidebar.menu-sub-item>
</hw:sidebar.menu-sub>
</hw:sidebar.menu-item>
</hw:sidebar.menu>
</hw:sidebar.group-content>
</hw:sidebar.group>
</hw:sidebar.content>
<hw:sidebar.footer>
<hw:sidebar.menu>
<hw:sidebar.menu-item>
{{-- No href, so this renders a <button type="button">. --}}
<hw:sidebar.menu-button>
<x-lucide-user class="size-4" />
<span>Account</span>
</hw:sidebar.menu-button>
</hw:sidebar.menu-item>
</hw:sidebar.menu>
</hw:sidebar.footer>
</hw:sidebar>
<hw:sidebar.inset class="p-6">
<p class="text-sm font-medium">Main content</p>
<p class="mt-1 text-sm text-muted-foreground">
<code>sidebar.inset</code> is the content area beside the panel.
</p>
</hw:sidebar.inset>
</hw:sidebar.provider>
The trigger
sidebar.trigger toggles whichever provider is above it, so it can sit anywhere inside one — typically in the top bar of sidebar.inset. sidebar.rail is the second toggle: an edge strip inside the panel.
Click it — the page sidebar collapses.
Same button as the one in this page's top bar. sidebar.rail is the other
toggle: an edge strip inside the panel itself, which the page sidebar also carries.
{{-- The trigger dispatches to the nearest sidebar controller above it. This one sits
outside any nested provider, so it toggles the sidebar framing this page. --}}
<hw:sidebar.trigger class="border bg-background" />
Collapsible modes
ConceptualThe collapsible panel is position: fixed by preset, so it cannot honestly live inside a demo card — the sidebar framing this page is the live example, and the trigger above drives it. Narrow the viewport to see offcanvas instead of icon.
sidebar.provider- State wrapper. Mounts the controller and exposes the width CSS variables.
sidebar- The panel itself. Owns side, variant and collapsible.
sidebar.inset- The content area beside the panel.
sidebar.trigger / sidebar.rail- Toggles: a button anywhere, or the edge strip inside the panel.
sidebar.header / content / footer- The three layout regions.
sidebar.brand- Header link with separate expanded and icon-collapsed content.
sidebar.group / group-label / group-action / group-content- A titled navigation section.
sidebar.menu / menu-item / menu-button- The primary menu structure.
sidebar.menu-action / menu-badge / menu-skeleton- Per-item affordances.
sidebar.menu-sub / menu-sub-item / menu-sub-button- One nested level.
sidebar.input / sidebar.separator- Search field and divider, styled for the panel.
{{-- offcanvas (default): slides away entirely --}}
<hw:sidebar collapsible="offcanvas">...</hw:sidebar>
{{-- icon: collapses to the icon rail; labels are hidden, icons stay --}}
<hw:sidebar collapsible="icon">
<hw:sidebar.rail />
</hw:sidebar>
{{-- none: a plain <aside>, no state and no fixed positioning --}}
<hw:sidebar collapsible="none">...</hw:sidebar>
{{-- The trigger can sit anywhere inside the provider --}}
<hw:sidebar.inset>
<header><hw:sidebar.trigger /></header>
</hw:sidebar.inset>
Variant, side and persistence
Conceptualvariant takes sidebar, floating or inset. side is physical and does not mirror in RTL. The provider persists the desktop expanded state in cookie-name, which is why a reload keeps it where you left it.
Collapse the sidebar framing this page, reload, and it stays collapsed — that is
cookie-name at work, with no application code behind it.
{{-- variant: sidebar (default), floating, inset --}}
<hw:sidebar variant="floating" />
{{-- side is physical and does not mirror in RTL --}}
<hw:sidebar side="right" />
{{-- The provider persists the desktop state in a cookie --}}
<hw:sidebar.provider cookie-name="settings_sidebar" width="18rem" icon-width="3.5rem" />