DropdownMenu

Dropdown menus group secondary commands behind a compact trigger.

Overview and decision boundary

Use DropdownMenu to group secondary commands behind a compact trigger.

Do not hide the primary page action inside a menu.

Preview

import { DropdownMenu } from '@nerio-ui/ui/client';<DropdownMenu trigger="Actions" items={[{ label: "Rename" }]} />

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add dropdown-menuimport { DropdownMenu } from '@nerio-ui/ui/client';

Usage

import { DropdownMenu } from '@nerio-ui/ui/client';<DropdownMenu trigger="Actions" items={[{ label: "Rename" }]} />

Variants

VariantPurpose
defaultDefault variant using semantic Nerio tokens.
destructiveRisky action that needs explicit intent.

Anatomy

SlotPurpose
contentLayered menu surface.
itemCommand row with optional destructive intent.

States

StatePurpose
OpenItems are keyboard navigable.
HighlightedCurrent item is ready for selection.
DisabledUnavailable items stay in context without activation.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • Uses the Base UI Menu primitive.
  • Items are keyboard reachable and can be disabled.
  • Disabled items stay visible but cannot be selected.
  • Use destructive tone only for irreversible or high-risk commands.
  • Supports controlled open, uncontrolled defaultOpen, onOpenChange, and a forwarded menu popup ref.

API

PropPurpose
itemsSmall list of label, onSelect, disabled, and destructive flags.
disabled itemStays visible in context without activation.
destructive itemMarks risky commands without changing the whole menu tone.

Implementation contract

ContractValue
Registry itemdropdown-menu installs 6 source files into the configured components directory.
Base UImenu
Registry dependenciesbutton
Package dependencies@base-ui/react, clsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use DropdownMenu to group secondary commands behind a compact trigger.

Do / do not

Do

Use for Rename, Duplicate, Archive, and similar secondary commands.

Do not

Do not hide the primary page action inside a menu.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-dropdown-min-widthPublic customization point for this component contract.
--n-dropdown-item-padding-inlinePublic customization point for this component contract.
--n-dropdown-radiusPublic customization point for this component contract.
--n-overlay-z-indexPublic customization point for this component contract.
--n-overlay-backgroundPublic customization point for this component contract.
--n-overlay-borderPublic customization point for this component contract.
--n-overlay-foregroundPublic customization point for this component contract.
--n-overlay-foreground-mutedPublic customization point for this component contract.
--n-overlay-control-backgroundPublic customization point for this component contract.
--n-overlay-surface-filterPublic customization point for this component contract.
--n-overlay-dangerPublic customization point for this component contract.
--n-overlay-shadowPublic customization point for this component contract.
--n-motion-hover-durationPublic customization point for this component contract.
--n-motion-hover-easingPublic customization point for this component contract.
--n-motion-overlay-enter-durationPublic customization point for this component contract.
--n-motion-overlay-enter-easingPublic customization point for this component contract.
--n-motion-overlay-exit-durationPublic customization point for this component contract.
--n-motion-overlay-exit-easingPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.