DropdownMenu

A short list of actions on one item.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/dropdown-menu.json

Row actions

Trigger = round 44 IconButton (more-horizontal). Menu: padding 4, radius 16, shadow-menu; items 44 high, radius 12, hover bg-accent. Motion: transitions.dev menu dropdown: grows from the trigger edge, scale .97 → 1 + fade, open 250 / close 150 to .99, ease-smooth-out.

Button trigger

A secondary Button with a chevron when the trigger needs a label.

Open state (inline)

Highlighted, disabled (60 %), destructive (danger text, no red fill). The current item is named in words.

When to use

  • A short list of actions on one item: a table row (Lihat detail, Ubah, Arsipkan).
  • Secondary actions that do not fit as buttons: Ekspor → Unduh Excel / Unduh PDF.
  • The account menu and the company switcher in the top bar.

When not to use

  • Picking a value for a form → Select.
  • Going to another page → ListRow or the rail.
  • One or two actions → show them as buttons.
  • Choices with ticks or checkboxes → not supported; use ChoiceCard in a Sheet.

Do and don't

DoDestructive last, after a separator"Arsipkan karyawan" in danger text at the bottom; it opens a destructive Dialog.
Don'tTicks, checkboxes, sub-menusThey hide state in a menu that closes. Name the current item in words, and use a Sheet for choices.

Installation

Add DropdownMenu with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/dropdown-menu.json

API

import { DropdownMenu, DropdownMenuIconTrigger, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "@/components/ui/dropdown-menu"
PropTypeDefaultDescription
DropdownMenuIconTrigger labelstring"Menu lainnya"Round 44 trigger; label is the aria-label (name the row: "Menu Ayu Wulandari").
DropdownMenuIconTrigger variant"secondary" | "ghost""secondary"ghost in every table / list row (no raised edge, fills on hover, 44 target): many "⋯" in a column stay quiet. secondary when the trigger stands alone (a card header).
DropdownMenuTrigger renderReactElement–Any trigger, e.g. a Button with a chevron.
DropdownMenuContent align · sideOffset"start" | "center" | "end" · number"end" · 8Opens under the trigger.
DropdownMenuItem destructivebooleanfalseDanger text and icon; no red fill.
DropdownMenuItem disabled · onClickboolean · () => void–Base UI Menu.Item props.