Krizaka UI
Krizaka UI
Components

Account menu

The menu under a signed-in person's avatar: who they are, their profile and settings, the language as a compact submenu, Sign out.

Web · ✓Mobile · n/aDesktop · ✓BetaNavigation
import { AccountMenu } from "@krizaka/ui/account-menu";

Web only — React, from @krizaka/ui/account-menu. Beta: its API may still change in a minor version.

  • Mobile · n/a. On a phone the account is a screen of the tab bar, not a menu. → Settings layout

Why it is here. Used by Orazaka, Yomizaka, Akinaza.

When to use

  • The top bar of a signed-in web app, at the right.
  • Any app that offers profile, settings, language and Sign out in one place.

When not to use

  • For the actions of an item (edit, share, delete).Use instead: Dropdown menu
  • For the navigation between the app's sections.Use instead: Nav bar

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { AccountMenu } from "@krizaka/ui/account-menu";

Examples

Account menu

Identity, profile and settings links, a language submenu and Sign out.

Props

The account menu: avatar trigger → identity header, links, language submenu, Sign out.

PropTypeDefaultDescription
labelrequiredstring—The trigger's accessible name (Account).
signOutrequired{ label: string; onSelect: () => void; icon?: ReactNode; }—The last row: its words, what it does, an optional icon.
avatarOmit<AvatarProps, "size">—The picture: src, or defaultAvatar ({ brand, seed }) for the product's default person.
childrenReactNode—Extra rows between the language and Sign out (a theme switch…).
classNamestring—Classes for the trigger.
emailstring—Their e-mail, shown under the name.
languageAccountMenuLanguage—The language, as a submenu that shows the current one.
linkAsElementType<any, keyof IntrinsicElements>aThe app's link component (Next's Link); an <a> otherwise.
linksreadonly AccountMenuLink[][]Where to go: profile, settings…
namestring—Their name; falls back to the e-mail.
showNameboolean | "sm" | "lg"trueShow the name beside the avatar in the trigger: true or "sm" from 640 px, "lg" from 1024 px (the family's top bar, where search and the counts take the room below it), false never.

Accessibility

  • The trigger is named by label; the menu is a Radix menu (roving focus, typeahead).

Keyboard

KeysAction
Enter / Space / Arrow downOpens the menu from the avatar.
Arrow right / Enter on LanguageOpens the language choices; Arrow left or Esc goes back.
EscCloses the menu and returns the focus to the avatar.

Best practices

  • Identity first (picture, name, e-mail), then places, then preferences, then Sign out last.
  • Use the product's defaultAvatar ({ brand, seed }) when there is no photo; never a grey silhouette or an initials tile.
  • Sign out is a quiet item: it is not a destructive action, so it is not red.
  • In the family's top bar (AppHeader account), showName="lg": the name from 1024 px, where search and the counts no longer need the room.

Generated from the code of @krizaka/ui 3.63.1: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page