Sidebar
A sidebar built from composable parts. Drag its edge to resize, collapse it away, and on mobile it becomes a drawer.
Installation
Install Sidebar from the Fluid Effect UI registry.
Playground
Layouts — Sidebar
Layouts — Floating
Layouts — Inset
Nesting
Actions & badges
Header & footer
Stack the header and footer content vertically or horizontally.
Vertical stacking
Horizontal stacking
Callouts
Elevate and promote news with stackable banners or inlines.
Stacked inlines
Stacked banners
Resize, collapse & peek
Drag to resize, click to collapse, or press [. Open the sidebar on click or hover.
AAurora AI
Workspace
On hover
On click
Inside a dialog
No icon rail version?
Functional and perfectly aligned
API Reference
Types come from the public API. A dash indicates no default is documented here.
SidebarShell props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | ((events: never) => NoInfer<Msg> | undefined) | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.id | string | Required | |
props.reducedMotion | "user" | "always" | "never" | 'user' | |
props.width | number | 256 | |
props.side | "left" | "right" | 'left' | |
props.shortcut | string | null | — | |
props.variant | "inset" | "sidebar" | "floating" | 'sidebar' | |
props.defaultOpen | boolean | true | |
props.peek | "click" | "none" | "hover" | 'none' | |
props.persist | boolean | true | |
props.mobileBreakpoint | number | 768 | |
content | (info: SidebarShellContentInfo) => View.Children<Msg, R> | Required | |
mobileContent | (info: SidebarShellContentInfo) => View.Children<Msg, R> | p.content | |
inset | (parts: SidebarShellParts) => View.Children<Msg, R> | Required | |
showCloseButton | boolean | — | |
title | string | 'Sidebar navigation' | |
className | string | — | |
panelClassName | string | — | |
insetClassName | string | — |
Sidebar
Public source
| Prop | Type | Default | Description |
|---|---|---|---|
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "Toggled"; readonly open: boolean; readonly reason: "find-in-page" | "trigger-press"; } | { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined) | { readonly Toggled: (event: { readonly _tag: "Toggled"; readonly open: boolean; readonly reason: "find-in-page" | "trigger-press"; }) => NoInfer<Msg> | undefined; readonly Settled: (event: { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.open | boolean | Required | |
props.disabled | boolean | undefined | — | |
props.holdExit | boolean | undefined | — | |
props.keepMounted | boolean | "css" | undefined | — | |
props.hiddenUntilFound | boolean | undefined | — | |
header | View.Content<Msg, R> | — | |
children | View.Children<Msg, R> | Required | |
footer | View.Content<Msg, R> | — | |
trigger | View.Content<Msg, R> | '☰' | |
ariaLabel | string | 'Sidebar' | |
width | number | 256 | |
collapsible | "none" | "offcanvas" | — | |
side | "left" | "right" | 'left' | |
variant | "inset" | "sidebar" | "floating" | 'sidebar' | |
className | string | — | |
contentClassName | string | — |
SidebarTrigger
Public source
| Prop | Type | Default |
|---|---|---|
parts | Show type{ root: View.Part<"div", [], never>; trigger: View.Part<"button", [], never>; desktop: View.Part<"div", [], Scope>; panel: View.Part<"aside", [], never>; rail: View.Part<"button", [], never>; peek: View.Part<"button", [], never>; dialog: { open: boolean; mounted: boolean; transitionStatus: DialogTransitionStatus; nested: boolean; nestedDialogs: number; openMethod: "keyboard" | "mouse" | "pen" | "touch" | null; closeMethod: "keyboard" | "mouse" | "pen" | "touch" | null; triggerId: string | null; trigger: (<B extends View.PartTarget<"button">>(element: B) => ReturnType<B["attr"]>) & Pick<View.Part<"button", [triggerId: string | null, key: string, disabled: boolean], never>, "~R">; portal: (<B extends View.PartTarget<"dialog">>(element: B) => ReturnType<B["attr"]> | undefined) & Pick<View.Part<"dialog", [], never>, "~R">; backdrop: (<B extends View.PartTarget<"div">>(element: B) => ReturnType<B["attr"]> | undefined) & Pick<View.Part<"div", [], never>, "~R">; viewport: View.Part<"div", [], never>; popup: View.Part<"div", [], never>; title: (<B extends View.PartTarget<"h1" | "h2" | "h3" | "h4" | "h5" | "h6">>(element: B) => ReturnType<B["attr"]>) & Pick<View.Part<"h1" | "h2" | "h3" | "h4" | "h5" | "h6", [id: string], never>, "~R">; description: (<B extends View.PartTarget<"p">>(element: B) => ReturnType<B["attr"]>) & Pick<View.Part<"p", [id: string], never>, "~R">; close: View.Part<"button", [], never>; initialFocus: View.Part<string, [], never>; finalFocus: View.Part<string, [], never>; }; open: boolean; mobile: boolean; mobileOpen: boolean; peeking: boolean; resizing: boolean; width: number; side: "left" | "right"; variant: "inset" | "sidebar" | "floating"; peekEnabled: boolean; ownerId: string; shortcut: string | null; } | Required |
compact | boolean | — |
className | string | — |
label | string | icon |