About Account Switcher
Account Switcher is a menu component that allows users to switch between multiple accounts, organizations, or workspaces. Built on the Menu component, it provides account selection with grouping and badge support.Components
- AccountSwitcher - Main menu container
- AccountSwitcherItem - Individual account option
- AccountSwitcherItemRadio - Radio selection for current account
- AccountSwitcherGroup - Group related accounts
- AccountSwitcherBadge - Badge for account status
- AccountSwitcherSeparator - Visual divider
- useAccountSwitcherState - Hook for managing menu state
Installation
Usage
Props
AccountSwitcher
Accepts all Menu props for state management.AccountSwitcherItem
AccountSwitcherItemRadio
AccountSwitcherGroup
AccountSwitcherBadge
State Management
UseuseAccountSwitcherState hook to manage menu state:
Grouping Accounts
Use AccountSwitcherGroup to organize accounts:Accessibility
- Uses semantic menu markup with proper ARIA attributes
- Keyboard navigation with arrow keys
- Radio groups properly labeled
- Menu state announced to screen readers
- Focus management when opening/closing
Related components
- Menu - Base menu component
- Product Switcher - Product selection
- User Dialog - User menu