Skip to Content
Liquid Glass UI
Components

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 with 22px corner radii and <LiquidSurfaceBackdrop /> edge refraction above the canvas; variant="inset" and variant="sidebar" also use an isolated -z-10 glass 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 at 55% container width).
  • Responsive cross-platform UX: Toggle expanded vs. icon collapse mode on desktop via ⌘B / Ctrl+B or <SidebarTrigger> (with Liquid Glass Tooltips and cascading DropdownMenu flyouts for nested <SidebarMenuSub> trees); automatically switches to a slide-over Liquid Glass Sheet on 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:

apple-liquid-ui/preview/sidebar-liquid-hero
MacBook · 16:10

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/sidebar

Inset Split Workbench

Ideal for Mail or Notes master-detail layouts with an elevated rounded main pane:

apple-liquid-ui/preview/sidebar-inset
MacBook · 16:10

Right Inspector (side="right")

Set side="right" for a trailing design-tool inspector while keeping full optical droplet refraction for embedded Switch controls:

apple-liquid-ui/preview/sidebar-right
MacBook · 16:10

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

PropTypeDefaultDescription
defaultOpenbooleantrueInitial uncontrolled desktop open state
openboolean—Controlled open state
onOpenChange(open: boolean) => void—Callback fired when open state changes (persisted via cookie)
defaultWidthnumber256Initial uncontrolled desktop width (px)
widthnumber—Controlled desktop width (px)
onWidthChange(width: number) => void—Callback fired on resize or reset
minWidthnumber180Minimum drag width (px)
maxWidthnumber480Maximum drag width (px, also bounded by 55% of container width)
PropTypeDefaultDescription
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)
glassbooleantrueLiquid Glass material reacting to glass tint; false renders 100% opaque
resizablebooleantrueShow 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.

PropTypeDefaultDescription
glassbooleantrueLiquid Glass material reacting to glass tint; false renders 100% opaque

SidebarMenuSub

PropTypeDefaultDescription
openbooleantrueControls 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.

PropTypeDescription
localeLiquidGlassLocaleInputUI language of this component (any BCP 47 tag; unsupported ones fall back to English)
messagesPartial<SidebarMessages>Text overrides, merged over the built-in text and the global messages.sidebar
KeyBuilt-in text (English)
titleSidebar
toggleToggle Sidebar
expandDragAriaLabelDrag to expand sidebar
resizeAriaLabelResize sidebar
expandDragTitleDrag to expand sidebar, double-click to reset
resizeTitleDrag to resize, double-click to reset
railAriaLabelResize or toggle sidebar
railTitleDrag to resize, click to toggle, double-click to reset

On this page