IFFDAYIFFDAYDesign
Controls

Menu

A menu of actions opened from a button, with group labels, separators and links.

import { Menu, MenuItem, MenuLinkItem, MenuSeparator, MenuLabel } from '@iffday/ui';

Example

Menu opens 6px below its trigger and is at least 210px wide. Focus moves into the menu; the arrow keys move through it, typing jumps to a matching item, and Escape or a click outside closes it and returns focus to the button. Base UI handles all of this.

Usage

  • Pass the trigger as trigger; it keeps its own look. An icon-only trigger needs an aria-label.
  • For navigation use MenuLinkItem with the site’s Link in render; the menu closes itself after the click.
  • MenuLabel titles a group and MenuSeparator divides groups. Put actions with serious consequences, such as Withdraw and Report, in the last group.

Props

A dropdown menu: Base UI owns focus, typeahead, Escape and outside press.

PropTypeDefault
trigger*

The trigger element; it is rendered through Base UI so it keeps its own markup.

ReactElement<Record<string, unknown>>
children*ReactNode
sideSide'bottom'
alignAlign'start'
labelstring
openboolean
onOpenChange(open: boolean) => void
PropTypeDefault
className''

Other props go to ComponentProps<typeof BaseMenu.Item> (see the Base UI documentation).

A navigation entry. Pass the app's router link through `render`.

PropTypeDefault
className''

Other props go to ComponentProps<typeof BaseMenu.LinkItem> (see the Base UI documentation).

No props.

PropTypeDefault
children*ReactNode