Loading component…
Loading component…
Account card with the signed-in user, menu actions and profile setup progress
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ProfileMenu from ./profile-menu.
import { ProfileMenu, SettingsIcon, LogoutIcon } from "@/components/ui/profile-menu";
export function Account() {
return (
<ProfileMenu
name="Lena Hartmann"
email="lena.hartmann@fastmail.com"
items={[
{ id: "settings", label: "Settings", icon: <SettingsIcon />, onSelect: openSettings },
{ id: "logout", label: "Logout", icon: <LogoutIcon />, onSelect: signOut },
]}
setup={{ done: 3, total: 5, next: "Add a profile photo", onContinue: openProfile }}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| name | string | Name of the signed-in user | |
| string | Email under the name, cut off with an ellipsis when long | ||
| avatar | ReactNode | Replaces the default avatar, e.g. an <img> | |
| items | ProfileMenuItem[] | Actions with label, icon, optional badge and onSelect | |
| setup | ProfileSetup | Profile setup progress: done, total, the next step and onContinue – leave empty to hide | |
| className | string | Extra class on the card |
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"
@import "tailwindcss"; in your main CSS file.