Component librarySidebar
Sidebar
ProCollapsible workspace navigation with an inline mobile menu.
npx shadcn@latest add @tidal-pro/sidebarInstallation
Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.
Terminal
Import components/ui/tidal.css, components/ui/sidebar.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.
Usage
Complete example source · Dependency and asset manifest
Loading the complete example…
API & behavior
TidalSidebar wraps navigation, optional footer and page children. Required title and navigation; optional mark, navigationLabel(defaultWorkspace), controlled collapsed/onCollapsedChange or defaultCollapsed. Root forwards native div attributes/ref. ResizeObserver measures its own container: at560px or wider it shows an expanded218px or collapsed66px rail; below560px it becomes an in-flow nonmodal disclosure. Mobile menu never overlays the page or traps focus; native toggle announces expansion, Escape closes from within the component and returns navigation-owned focus, selection closes and returns focus when it owns focus. Compact navigation is bounded240px with internal scrolling. Resizing transfers focus away from controls being hidden. Collapsed desktop state persists independently of mobile open state. No global shortcut, storage, URL routing, requests or sample workspace is introduced by source. TidalSidebarGroup requires label and forwards div/ref/attributes. TidalSidebarLink forwards native anchor attributes/ref/events, requires label, supports decorative icon, visual-only badge and active(aria-current=page). Supply your own accessible label if a badge carries essential meaning. Normal unmodified same-tab links close mobile navigation; modifier clicks, targets, download and prevented events preserve native behavior. TidalSidebarAction forwards button/ref/events/type(defaultbutton)/disabled, supports the same label/icon/badge/active(aria-pressed when active) and closeOnSelect(defaulttrue). Caller-prevented click skips closing. Consumer owns destination, selected page, submissions and any main-content focus policy. Icons must remain decorative; the literal label stays accessible in collapsed mode. Footer content is consumer-owned and should use the supplied items for collapse behavior. Original neutral surfaces, selected edge, icon feedback, width transition and finite coordinated group entrances; full labels wrap,44px controls, scoped light/dark tokens and reduced motion. Container sizing needs ResizeObserver (modern browsers); initial server render is compact for safe hydration.
Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.