Skip to contentKino
Skip to Content

User menu

The signed-in person behind their avatar, with their account, their workspaces, the theme and Sign out. A menu that opens as a bottom sheet on a phone.

npx shadcn add https://kinoui.com/r/user-menu.json
Share on

Examples

Kino

Default

Who is signed in, their pages, their workspaces, the theme and Sign out, every choice one press away. A workspace pick closes the menu, since the page changes.

Installation

npx shadcn@latest add https://kinoui.com/r/user-menu.json
Files
lib/reduce-motion.tslib/scroll.tscomponents/kino/separator.tsxlib/popup.tslib/resize.tslib/run-progress.tslib/highlight.tslib/menu.tsxlib/controllable.tslib/grip.tslib/panel.tsxlib/refs.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/sheet.tsxcomponents/kino/drawer.tsxlib/roomy.tslib/menu-sheet.tsxcomponents/kino/dropdown-menu.tsxcomponents/kino/preferences.tsxlib/pill.tscomponents/kino/segmented-control.tsxlib/glide.tsxcomponents/kino/tooltip.tsxcomponents/kino/theme-switcher.tsxcomponents/kino/user-menu.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

UserMenu

PropTypeDefaultDescription
openbooleanNoneWhether it is open, to control it with onOpenChange.
defaultOpenbooleanfalseWhether it is open at first, uncontrolled.
onOpenChange(open, details) => voidNoneCalled when it opens or closes, in the menu or the sheet. details.cancel() keeps it as it was.

UserMenuContent

PropTypeDefaultDescription
titlestring'Account'Names the sheet for a screen reader on a phone.
side'left''top''bottom''right''inline-start' | 'inline-end''bottom'Which side of the trigger the menu opens on. inline-start and inline-end follow the reading direction.
align'start''center''end''end'Where the menu lines up along that side.

UserMenuHeader

PropTypeDefaultDescription
nameReactNodeNoneTheir name.
emailReactNodeNoneTheir email, under the name.
avatarReactNodeNoneTheir Avatar (opens in a new tab), at sm.

UserMenuWorkspaces

PropTypeDefaultDescription
valuestringNoneThe workspace they’re in, with onValueChange.
defaultValuestringNoneThe workspace at first, uncontrolled.
onValueChange(value: string, event: Event | undefined) => voidNoneCalled with the workspace picked.
labelReactNode'Workspaces'The heading; null leaves it out, as in a submenu, with an aria-label instead.

UserMenuWorkspace

PropTypeDefaultDescription
valuestringNoneWhich workspace it is.
logoReactNodeNoneIts logo, an svg the size of the rows’ icons.
descriptionReactNodeNoneRead at the row’s end, such as its plan.

UserMenuTheme

PropTypeDefaultDescription
labelstring'Theme'Beside the icons, and their name for a screen reader.
inlinebooleantrueOne row of icons; false for three rows with their names, as in a submenu.
crossover'fade''reveal''band''fade'How the page crosses over to the new theme.

UserMenuSubTrigger

PropTypeDefaultDescription
sheetLabelReactNodeNoneWhat the heading reads on a phone, where the row also names the pick. Its own content when left out.

Data attributes

AttributeOnDescription
data-sloteach partuser-menu-trigger, user-menu-content, user-menu-header, user-menu-workspace and so on, on each part that renders an element, to style it from outside. The theme keeps the Theme switcher’s own.

CSS variables

VariableSet it onDefaultDescription
--menu-max-heightUserMenuContent’s style36remHow tall the menu grows before its rows scroll.

Accessibility

  • The menu follows the menu button pattern: Up and Down move through every row, Left and Right also move along the theme’s icons, and Escape closes it and returns focus to the trigger.
  • The header is a group named by the person’s name, so it is read when the menu opens.
  • Each theme icon is a radio item with its name, such as “Dark”.
  • On a phone the sheet is a dialog named by title: Tab moves through its rows, a swipe down or Escape closes it, and focus returns to the trigger.
  • Name an avatar trigger with text inside it, not aria-label: an avatar without a photo shows initials, and a name that doesn’t hold what it shows fails voice control.