1 variant
Action Menu
A dropdown menu with icons, shortcuts, toggles, and destructive actions.
My account
import { Settings, User } from "lucide-react";
import {
ActionMenu,
ActionMenuContent,
ActionMenuItem,
ActionMenuTrigger,
} from "@/components/registry/action-menu";
export function AccountMenu() {
return (
<ActionMenu>
<ActionMenuTrigger aria-label="Open menu">⋯</ActionMenuTrigger>
<ActionMenuContent>
<ActionMenuItem icon={<User className="h-4 w-4" />}>Profile</ActionMenuItem>
<ActionMenuItem icon={<Settings className="h-4 w-4" />} shortcut="⌘,">
Settings
</ActionMenuItem>
</ActionMenuContent>
</ActionMenu>
);
}"use client";
import { Check } from "lucide-react";
import { motion, useReducedMotion } from "motion/react";
import {
type ButtonHTMLAttributes,
createContext,
type KeyboardEvent,
type ReactNode,
type RefObject,
useCallback,
useContext,307 more lines ship with an easeUI Pro license.
Buy a licenseInstall
Props
ActionMenu
openbooleanPass it to control the menu yourself. Left off, the menu keeps its own state.
defaultOpenbooleanDefault falseStarting state when uncontrolled.
onOpenChange(open: boolean) => voidCalled whenever the menu wants to open or close.
childrenRequiredReactNodeA trigger and a content panel.
classNamestringMerged last, so anything passed here wins over the component's own classes.
ActionMenuTrigger
childrenRequiredReactNodeUsually a single icon. Give the button an aria label when it is.
...propsButtonHTMLAttributesEverything except type, id, onClick and onKeyDown, which the menu owns.
ActionMenuContent
align"start" | "end"Default "start"Which trigger edge the panel hangs from. It flips above the trigger on its own when there is no room below.
childrenRequiredReactNodeItems, toggle items, labels and separators.
classNamestringMerged last, so anything passed here wins over the component's own classes.
ActionMenuItem
onSelect() => voidRuns, then closes the menu and returns focus to the trigger.
disabledbooleanDefault falseSkipped by arrow key navigation as well as by the pointer.
iconReactNodeLeading mark, hidden from screen readers.
shortcutstringTrailing hint, such as ⌘K.
destructivebooleanDefault falseColors the item for something that deletes.
childrenRequiredReactNodeThe label.
classNamestringMerged last, so anything passed here wins over the component's own classes.
ActionMenuToggleItem
checkedRequiredbooleanDrives the check mark and aria checked.
onCheckedChangeRequired(checked: boolean) => voidThe menu stays open, since a toggle is not a navigation.
disabledbooleanDefault falseSkipped by arrow key navigation.
childrenRequiredReactNodeThe label.
classNamestringMerged last, so anything passed here wins over the component's own classes.