Workspace Switcher
A sidebar-header workspace dropdown with plan badges, a create row and search for long lists.
Copy a prompt for your AI coding tool with the source, dependencies and usage
Props
WorkspaceSwitcherProps
Also accepts all props of Omit<React.ComponentProps<"div">, "defaultValue" | "onChange">
| Prop | Type | Default | Description |
|---|---|---|---|
| workspaces* required | Workspace[] | — | — |
| value | string | — | Selected workspace id (controlled) |
| defaultValue | string | — | — |
| onValueChange | (id: string) => void | — | — |
| onCreate | () => void | — | — |
| searchThreshold | number | 5 | A search field is shown when there are more workspaces than this |
| defaultOpen | boolean | false | Render the list open on mount (without moving focus) |
Install
$ npx shadcn@latest add https://chromotion.dev/r/workspace-switcher.json