Skip to Content
Kokonut UI

NV-04Navigation

Account Menu

An account card that morphs into its own menu, with account switching, status, theme and hold-to-sign-out.

Install with
lucide-react, motion

PRODocs Search and more like it are in Kokonut UI Pro

Installation

Account Menu is a free, open-source React component in the Kokonut UI Navigation collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/profile-dropdown.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/profile-dropdown

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/profile-dropdown.tsx.

npm install lucide-react motion

Usage

import ProfileDropdown from "@/components/kokonutui/profile-dropdown";

export default function Example() {
  return <ProfileDropdown />;
}

Props

accounts
Account[]Default built-in
defaultAccountId
string
onAccountChange
(account: Account) => void
onAddAccount
() => void
items
ProfileMenuItem[]Default built-in

Menu entries between the settings rows and Switch account.

theme
AccountTheme

Controlled theme. Leave it out to keep the choice in local state.

defaultTheme
AccountThemeDefault "system"
onThemeChange
(theme: AccountTheme) => void
status
AccountStatus
defaultStatus
AccountStatusDefault "online"
onStatusChange
(status: AccountStatus) => void
onSignOut
() => void

Called once Sign out has been held for holdDuration ms.

holdDuration
numberDefault 1200

Also takes every prop of Omit<HTMLAttributes<HTMLDivElement>, "onChange">.

Account

idrequired
string
namerequired
string
emailrequired
string
initials
string

Shown in the avatar. Defaults to the first letters of name.

plan
string

Plain label shown in the menu header, such as "Pro".

ProfileMenuItem

labelrequired
string
icon
ReactNode
value
string

Quiet text on the right, such as a plan name or a shortcut.

href
string

Renders the item as a link. Without it the item is a button.

external
boolean

Opens href in a new tab.

onSelect
() => void

AccountTheme

type AccountTheme = "light" | "dark" | "system";

AccountStatus

type AccountStatus = "online" | "away" | "busy";

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.