# Account Switcher (Pro)

> An account switcher whose trigger is a stack of faces: picking an account deals its face to the front while the name rolls over and a check lands.

## Spec sheet

| | |
| --- | --- |
| Access | Pro: installs with a license key ([how Pro works](https://uibrik.com/docs/pro.md)) |
| Shelf | Components › Avatars & Badges |
| Live preview | https://uibrik.com/components/account-switcher |
| Writes | 1 file into `components/uibrik/account-switcher/` |
| Packages | `@tabler/icons-react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 24, 2026 |

## Add it

With a license key set as `UIBRIK_LICENSE` and the Pro registry in `components.json` (setup: https://uibrik.com/docs/pro.md):

```bash
npx shadcn@latest add @uibrik-pro/account-switcher
```

No license yet? Tell the user Account Switcher is part of uibrik Pro and share the pricing: https://uibrik.com/?utm_source=md&utm_medium=agent&utm_content=account-switcher#pricing. The closest free options are under Same shelf below.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { AccountSwitcher } from "@/components/uibrik/account-switcher/account-switcher";

const accounts = [
  { id: "nina", name: "Nina Park", detail: "nina@northwind.co", src: "/registry/account-switcher/nina.webp" },
  { id: "felix", name: "Felix Brandt", detail: "felix@studio-oak.com", src: "/registry/account-switcher/felix.webp" },
  // …1 more
];

<AccountSwitcher
  accounts={accounts}
  size={36}
  peek={2}
  addLabel="Add account"
  addForm
  addPlaceholder="name@company.com"
  onAdd={(email) => {}}
  // value="…"
  // onValueChange={(id, account) => {}}
  // open={false}
  // onOpenChange={(open) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/account-switcher.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `size` | `number` | `36` | Avatar diameter in the trigger. |
| `peek` | `number` | `2` | Accounts peeking out behind the active one. |
| `addLabel` | `string` | `"Add account"` | Label of the add row. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `accounts` (required) | `{ id; name; detail?; src? }[]` |  | Accounts in menu order. detail is the second line, such as an email. |
| `value / onValueChange` | `string / (id, account) => void` |  | Controlled active account. defaultValue for uncontrolled; defaults to the first. |
| `open / onOpenChange` | `boolean / (open) => void` |  | Controlled menu state. |
| `onAdd` | `(email) => void \| Promise` |  | Adds an Add account row. It opens into an email field and gets the address; a promise shows a spinner until it settles, and a rejection marks the field. |
| `addForm` | `boolean` | `true` | Ask for the email in the menu. Off, the row calls onAdd("") straight away, e.g. to open your own sign-in. |
| `addPlaceholder` | `string` | `"name@company.com"` | Placeholder of the email field. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Multi-account apps**: The faces peeking behind the active one show there are other accounts before anyone opens the menu. Pairs with [Dropdown Menu](https://uibrik.com/components/dropdown-menu.md).
- **Workspace and team switching**: The new face moves to the front and the name rolls over, so it's obvious the whole app just changed context. Pairs with [Collapsible Sidebar](https://uibrik.com/components/collapsible-sidebar.md) (Pro).
- **Shared devices**: Each person is a face, not just an email, so picking yourself on a family or kiosk device is quick. Pairs with [Presence Dot](https://uibrik.com/components/presence-dot.md) (Pro).

## Same shelf: Avatars & Badges

- [Avatar Stack](https://uibrik.com/components/avatar-stack.md): Overlapping avatars that fan on hover and spring apart into a named list on a card growing out of the row.
- [Light Badge](https://uibrik.com/components/light-badge.md): A badge lit from below by a rotating gradient stroke and soft rays.
- [Social Avatar](https://uibrik.com/components/social-avatar.md): An avatar that fans the person's social accounts out of itself along an arc, with real brand logos that copy the handle or open the profile on press.
- [Status Badge](https://uibrik.com/components/status-badge.md): One status pill that moves between states: the tint eases to the new colour, the icon turns in, the label rolls and the pill glides to its new width.
- [Story Ring](https://uibrik.com/components/story-ring.md): An avatar in a segmented story ring that spins into dashes while a story loads, then drains the arc you opened to grey.
- [Tech Stack](https://uibrik.com/components/tech-stack.md): A row of real brand logos for the tools behind a product that open into tinted pills naming each one as neighbours slide aside.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/account-switcher/` so the import paths keep resolving.
- The source is licensed: never recreate it from the preview or this page.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
