Sidebar
Responsive Apple Liquid Glass sidebar system with floating 22px-radius macOS 27 glass panels, icon collapse mode, resizable split handles, and automatic iOS 27 slide-over Sheet adaptation on mobile.
Fully compatible with all 24 standard shadcn/ui composable subcomponents (<SidebarProvider> / <Sidebar> / <SidebarInset> / <SidebarHeader> / <SidebarContent> / <SidebarFooter> / <SidebarGroup> / <SidebarMenu> / <SidebarMenuButton> / <SidebarMenuSub> / <SidebarTrigger> / <SidebarRail>, etc.):
- macOS 27 floating Liquid Glass (
variant="floating"): Floats with22pxcorner radii and<LiquidSurfaceBackdrop />edge refraction above the canvas;variant="inset"andvariant="sidebar"also use an isolated-z-10glass layer so inner controls keep full optical refraction. - Dynamic drag-to-resize split handle: Enabled by default (
resizable), fading in on hover/focus/drag in both expanded and collapsed states. Supports live width dragging, auto-collapse when pulled past minimum width, drag-out expansion from collapsed state, double-click width reset, and keyboard arrow nudging (capped at55%container width). - Responsive cross-platform UX: Toggle expanded vs.
iconcollapse mode on desktop via⌘B/Ctrl+Bor<SidebarTrigger>(with Liquid Glass Tooltips and cascadingDropdownMenuflyouts for nested<SidebarMenuSub>trees); automatically switches to a slide-over Liquid GlassSheeton mobile (< 768px). - Constant Apple Blue active pills: Selected menu items, sub-items, and badges use a constant soft Apple Blue pill legible at any glass tint level.
Responsive Live Preview
Includes SidebarInput search filtering, badge counters, 3-level nested submenus, and collapsed icon flyout menus; collapse via the top-left trigger or switch to the Mobile icon to inspect the slide-over glass Sheet:
Installation (Shadcn Registry)
# Install via the configured @apple-liquid namespace (includes sheet, dropdown-menu, input, button, tooltip, liquid-surface, etc.)
npx shadcn@latest add @apple-liquid/sidebarInset Split Workbench
Ideal for Mail or Notes master-detail layouts with an elevated rounded main pane:
Right Inspector (side="right")
Set side="right" for a trailing design-tool inspector while keeping full optical droplet refraction for embedded Switch controls:
Usage
import {
Sidebar,
SidebarContent,
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
SidebarInset,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarProvider,
SidebarTrigger,
} from '@/components/ui/sidebar';
export function AppLayout({ children }: { children: React.ReactNode }) {
return (
<SidebarProvider>
<Sidebar variant="floating" collapsible="icon">
<SidebarContent>
<SidebarGroup>
<SidebarGroupLabel>Navigation</SidebarGroupLabel>
<SidebarGroupContent>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton isActive tooltip="Home">
<span>Home</span>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
</Sidebar>
<SidebarInset>
<header className="flex h-12 items-center px-4">
<SidebarTrigger />
</header>
{children}
</SidebarInset>
</SidebarProvider>
);
}Props API
SidebarProvider
| Prop | Type | Default | Description |
|---|---|---|---|
defaultOpen | boolean | true | Initial uncontrolled desktop open state |
open | boolean | — | Controlled open state |
onOpenChange | (open: boolean) => void | — | Callback fired when open state changes (persisted via cookie) |
defaultWidth | number | 256 | Initial uncontrolled desktop width (px) |
width | number | — | Controlled desktop width (px) |
onWidthChange | (width: number) => void | — | Callback fired on resize or reset |
minWidth | number | 180 | Minimum drag width (px) |
maxWidth | number | 480 | Maximum drag width (px, also bounded by 55% of container width) |
Sidebar
| Prop | Type | Default | Description |
|---|---|---|---|
side | 'left' | 'right' | 'left' | Docking edge |
variant | 'sidebar' | 'floating' | 'inset' | 'sidebar' | Layout mode (docked / floating glass / inset split) |
collapsible | 'offcanvas' | 'icon' | 'none' | 'offcanvas' | Collapse mode (slide offscreen / icon rail / fixed) |
glass | boolean | true | Liquid Glass material reacting to glass tint; false renders 100% opaque |
resizable | boolean | true | Show drag-to-resize split handle between sidebar and main content |
SidebarInset
Main content container (<main>). Shares the large Liquid Glass surface (LiquidSurfaceBackdrop) by default, automatically switching inner content to Over-Glass.
| Prop | Type | Default | Description |
|---|---|---|---|
glass | boolean | true | Liquid Glass material reacting to glass tint; false renders 100% opaque |
SidebarMenuSub
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | true | Controls expanded submenu visibility while keeping nested trees available in collapsed icon flyout DropdownMenus |
SidebarTrigger
Forwards all Button props. Pass <SidebarTrigger glass /> outside glass containers; automatically switches to Over-Glass inside SidebarInset.
Language & Text
SidebarProvider accepts locale and messages, which apply to all of its parts and the overlays it opens and win over the global <LiquidGlassProvider locale messages>. To override the text globally, put it under messages.sidebar on the provider. See Liquid Glass → Global settings.
| Prop | Type | Description |
|---|---|---|
locale | LiquidGlassLocaleInput | UI language of this component (any BCP 47 tag; unsupported ones fall back to English) |
messages | Partial<SidebarMessages> | Text overrides, merged over the built-in text and the global messages.sidebar |
| Key | Built-in text (English) |
|---|---|
title | Sidebar |
toggle | Toggle Sidebar |
expandDragAriaLabel | Drag to expand sidebar |
resizeAriaLabel | Resize sidebar |
expandDragTitle | Drag to expand sidebar, double-click to reset |
resizeTitle | Drag to resize, double-click to reset |
railAriaLabel | Resize or toggle sidebar |
railTitle | Drag to resize, click to toggle, double-click to reset |
Sheet
Responsive Apple Liquid Glass side and bottom panel rendering a floating 26px-radius macOS 27 Liquid Glass inspector on desktop, and automatically adapting to an edge-hugging rounded iOS 27 drawer on mobile.
Skeleton
Apple 27-styled content placeholder inspired by SwiftUI redacted, featuring soft system fills and a gentle pulse animation tuned for standard, Liquid Glass, and Over-Glass surfaces.