Rebar UI

1.0

opinion

WorkspaceSwitcher

A header dropdown for switching between workspaces, with a create option.

Header switcherPick a workspace and the trigger follows
One workspace
Without create
Long name

In context

SidebarThe switcher heads the app's sidebar
MC

Harbour rebrand

On track
JW

Tideline mobile

Review
PN

Crew interviews

Late
LS

Rota export

Done

Props

PropTypeRequiredDefault
workspacesWorkspaceSwitcherItem[]Yes—
activeIdstringYes—
onSelect(id: string) => voidYes—
onCreateNew(() => void) | undefinedNo—
createLabelstring | undefinedNoNew workspace
classNamestring | undefinedNo—

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.