Workspace sidebar
A sidebar with workspace switcher, groups and the signed-in user.
When to use
- The main navigation of an application.
When not to use
- A public website.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/workspace-sidebar
Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
WorkspaceSidebar
13 props
PropTypeDefaultDescription
workspaces *readonly Workspace[]—
workspaceId *string—
onWorkspaceChange *(id: string) => void—
onCreateWorkspace(() => void)—
groups *readonly WorkspaceNavGroup[]—
activeId *string—
onNavigate *(id: string) => void—
favoritesreadonly string[][]Ids of pinned items.
onToggleFavorite((id: string) => void)—
onSearch(() => void)—
user *{ name: string; email: string; avatar?: string | undefined; }—
userMenureadonly { label: string; onSelect: () => void; destructive?: boolean | undefined; }[]—Menu entries for the user, as [label, action] pairs.
classNamestring—
Keyboard
- ↓
- Moves to the next item or value.
- ↑
- Moves to the previous item or value.
- ←
- Moves to the previous item or value.
- →
- Moves to the next item or value.
- Home
- Jumps to the first item or the minimum.
- End
- Jumps to the last item or the maximum.
Accessibility
It is built on native elements and keeps aria-current, aria-hidden, aria-pressed, aria-label, aria-expanded and aria-labelledby in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/workspace-sidebar.mdThe index of every part is at /llms.txt.