OrgSwitcher
Organisation switcher with multi-org support and profile modal/navigation.
The <OrgSwitcher> component lets signed-in users switch between organisations. It shows a dropdown of memberships and supports opening the organisation profile in modal or navigation mode.
Installation
pnpm add @wocha/ui @wocha/reactOr scaffold with the CLI
npx @wocha/cli init --framework nextjsBasic usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
getOrgLabel | (orgId: string) => string | — | Resolve organisation IDs to display labels |
createOrganisationUrl | string | — | URL for creating a new organisation |
onCreateOrganisation | () => void | — | Called when the user selects "Create organisation" |
organisationProfileMode | "modal" | "navigation" | "modal" | How the organisation profile opens |
organisationProfileUrl | string | — | Destination when organisationProfileMode is "navigation" |
appearance | WochaAppearance | — | Visual customisation |
className | string | — | Additional class name |
showSingle | boolean | false | Show switcher even when user has only one organisation |
fallback | ReactNode | — | Shown while auth context is loading |
Modal and navigation modes
Theming
Framework notes
| Framework | Notes |
|---|---|
| React SPA | Place in sidebar or header; requires multi-org user (orgIds on session) |
| Next.js | Client component; pair with OrganisationProfile page for navigation mode |