Dropdown Menu

DrawerEmpty State

A menu of actions opened from a trigger button.

Installation

pnpm add krz-ui

Usage

import { DropdownMenu, Button } from "krz-ui";
<DropdownMenu
  trigger={<Button variant="outline">Options</Button>}
  items={[
    { type: "label", label: "My account" },
    { label: "Profile", shortcut: "⌘P" },
    { label: "Settings" },
    { type: "separator" },
    { label: "Log out", danger: true },
  ]}
/>

API Reference

PropTypeDescription
triggerReactElementElement that toggles the menu, usually a Button.
itemsDropdownMenuItem[]Items, labels and separators.
align"start" | "end"Horizontal alignment to the trigger.
side"bottom" | "top"Which side the menu opens on.
className / style / ref—All go to the wrapper around the trigger. Style the popup with classNames.menu. See Customization.
classNames{ menu?, item?, icon?, shortcut?, separator?, label? }Extra classes for inner parts.