Floating sidebar app shell with collapsible icon mode, custom search palette, keyboard shortcuts modal, collapsible nav sections, and avatar-based user dropdown.
Installation
Usage
How It Works
- Uses shadcn
Sidebarwithcollapsible="icon"andvariant="floating"so the panel floats above the page content rather than pushing it. - A lightweight custom search palette (no external cmdk dependency) opens via
⌘ K(or click), filtering sidebar nav items in real time with fuzzy keyword matching inside aDialog. AppShell2PageHeaderrenders a breadcrumb trail with aSidebarTrigger, vertical separator, and an avatar dropdown menu for profile actions.- A keyboard shortcuts modal is accessible from the user dropdown, listing all available shortcuts with styled
Kbdbadges. - Sidebar sections support optional collapsing via the
collapsibleSubsectionsprop, animated with a CSSgrid-template-rowstrick for smooth height transitions. - Scroll fading masks (
bg-linear-to-b/bg-linear-to-t) are layered above and below the nav content to hint at overflowable content. - The user footer uses
OdysseyAvataras a fallback when no avatar image is available, deterministically picking a color from the user's name.
API Reference
AppShell2
| Prop | Type | Default |
|---|---|---|
config? | AppShell2Config | appShell2Config |
collapsibleSubsections? | boolean | false |
user? | SidebarUserInfo | - |
profileHref? | string | "/profile" |
onLogout? | () => void | - |
AppShell2PageHeader
| Prop | Type | Default |
|---|---|---|
pageName? | string | - |
breadcrumbs? | Array<{ label: string; href?: string }> | - |
actions? | React.ReactNode | - |
user? | SidebarUserInfo | - |
profileHref? | string | "/profile" |
onLogout? | () => void | - |
AppShell2Config
| Prop | Type | Default |
|---|---|---|
company? | SidebarCompany | - |
sections? | SidebarSection[] | - |