Skip to content

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.

On hover

On click

Inside a dialog

No icon rail version?

A

❌ Icon rail: six glyphs, one tooltip at a time

✅ Peek on hover: the whole sidebar, one hover

Functional and perfectly aligned

API Reference

Types come from the public API. A dash indicates no default is documented here.

SidebarShell props

Public source
PropTypeDefaultDescription
keystring | 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.idstringRequired
props.reducedMotion"user" | "always" | "never"'user'
props.widthnumber256
props.side"left" | "right"'left'
props.shortcutstring | null—
props.variant"inset" | "sidebar" | "floating"'sidebar'
props.defaultOpenbooleantrue
props.peek"click" | "none" | "hover"'none'
props.persistbooleantrue
props.mobileBreakpointnumber768
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
showCloseButtonboolean—
titlestring'Sidebar navigation'
classNamestring—
panelClassNamestring—
insetClassNamestring—
Sidebar
Public source
PropTypeDefaultDescription
keystring | 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.openbooleanRequired
props.disabledboolean | undefined—
props.holdExitboolean | undefined—
props.keepMountedboolean | "css" | undefined—
props.hiddenUntilFoundboolean | undefined—
headerView.Content<Msg, R>—
childrenView.Children<Msg, R>Required
footerView.Content<Msg, R>—
triggerView.Content<Msg, R>'☰'
ariaLabelstring'Sidebar'
widthnumber256
collapsible"none" | "offcanvas"—
side"left" | "right"'left'
variant"inset" | "sidebar" | "floating"'sidebar'
classNamestring—
contentClassNamestring—
SidebarTrigger
Public source
PropTypeDefault
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
compactboolean—
classNamestring—
labelstringicon