OrganizationSwitcher

Allow users to switch between organizations they belong to with a dropdown menu.

Live Demo

Organization Switcher Example
Click the dropdown to switch between organizations

Installation

Terminal

Basic Usage

AppLayout.tsx

Props

PropTypeDefaultDescription
currentOrganizationIdstring-ID of the currently active organization
onOrganizationSelect(org: any) => void-Callback fired when a different organization is selected
afterSelectOrganizationUrlstring | (org: any) => string'/dashboard'URL or function to redirect after selecting an organization
showCreateButtonbooleantrueShow "Create New Organization" button
showMemberCountbooleantrueDisplay member count for each organization
showSearchbooleantrueShow search input in dropdown
classNamestring-Additional CSS classes for container
buttonClassNamestring-Custom CSS classes for trigger button
dropdownClassNamestring-Custom CSS classes for dropdown menu

Custom Styling

CustomSwitcher.tsx

Direct API Usage

You can also manage organization switching directly via the API:

api-usage.ts

Features

Search & Filter

Quickly find organizations with built-in search functionality

Role Badges

Display user's role in each organization (Owner, Admin, Member)

Quick Create

Create new organizations directly from the switcher

Active Indicator

Visual indicator showing which organization is currently active

Common Use Cases

B2B SaaS Applications

Allow users to switch between different company accounts they belong to (e.g., consultant working with multiple clients)

Team Collaboration Tools

Users can switch between personal workspace and team workspaces

Multi-Tenant Platforms

Manage multiple tenants/organizations with isolated data and settings

Related Components