Org Switcher

A popover switcher for moving between organizations or workspaces, showing the current name, a check on the active item and an optional plan label per org.

src/registry/ui/org-switcher.tsx/r/org-switcher.json

Installation#

bash
npx shadcn@latest add @minidev/org-switcher

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/org-switcher.json

Usage#

tsx
import { OrgSwitcher } from "@/components/ui/org-switcher"

export function Example() {
  return (
    <OrgSwitcher
      value={org}
      onChange={setOrg}
      orgs={[
        { id: "1", name: "Acme", plan: "Studio" },
        { id: "2", name: "MiniDev", plan: "Premium" },
      ]}
    />
  )
}

API reference#

OrgSwitcher props
PropTypeDefault
orgsOrg[]SAMPLE_ORGS
valuestring-
onChange(id: string) => void-
classNamestring-

Dependencies#

npm

lucide-react

Built from

Examples#

All navigation components

Learn more