opinion
WorkspaceSwitcher
A header dropdown for switching between workspaces, with a create option.
Header switcherPick a workspace and the trigger follows
In context
SidebarThe switcher heads the app's sidebar
MC
On trackHarbour rebrand
JW
ReviewTideline mobile
PN
LateCrew interviews
LS
DoneRota export
Props
| Prop | Type | Required | Default |
|---|---|---|---|
workspaces | WorkspaceSwitcherItem[] | Yes | — |
activeId | string | Yes | — |
onSelect | (id: string) => void | Yes | — |
onCreateNew | (() => void) | undefined | No | — |
createLabel | string | undefined | No | New workspace |
className | string | undefined | No | — |
Built on Dropdown
The Slack, Notion and Linear header pattern, built on the real Dropdown for focus and keyboard handling. Omit onCreateNew to hide the create row.
data-rebar-* attributes
data-rebar-component="workspace-switcher" on the trigger button.
Migrating to Ant Design
Not codemod-covered. Compose AntD's Dropdown and Avatar to the same shape.