A trigger that opens a list of selectable items, built on Radix's DropdownMenu for focus management, keyboard navigation and close on outside click or Escape.

pnpm add @behivetech/atoms.dropdown-menu

You are viewing Dropdown Menu v0.4.1, snapshotted 2026-11-10. The latest is v0.4.2. Go to the latest →

A trigger that opens a list of selectable items, built on Radix's DropdownMenu for focus management, keyboard navigation and close on outside click or Escape.

Usage

1import { DropdownMenu } from "@behivetech/atoms.dropdown-menu";
2import { Button } from "@behivetech/atoms.button";
3
4function Example() {
5 const items = [
6 { id: "edit", label: "Edit" },
7 { id: "duplicate", label: "Duplicate" },
8 { id: "delete", label: "Delete", disabled: true },
9 ];
10 return (
11 <DropdownMenu
12 trigger={<Button variant="secondary">Actions</Button>}
13 items={items}
14 onSelect={(id) => alert(id)}
15 />
16 );
17}

Properties

DropdownMenu props

PropTypeDefaultDescription
items*DropdownMenuItem[]—Items rendered in the menu
onSelect*(id: string) => void—Called with the selected item's id when an item is chosen
trigger*ReactNode—Element that opens the menu when activated — receives the trigger's props via Radix's `asChild`
align"start" | "center" | "end"startAlignment of the menu relative to the trigger; defaults to "start"
classNamestring—Additional class names to merge with the menu content element
onOpenChange((open: boolean) => void)—Called when the open state changes (trigger click, item select, outside click, Escape)
openboolean—Controlled open state