Skip to contents
Interfaces DS
Landing Page

Dropdown Menu

Open a menu of actions from a button. Compare how the menu aligns with its trigger on each side.

On this page

Usage

Usage guidelines

Use a menu for a group of commands. Place a group label inside DropdownMenuGroup beside the items it describes.

Use DropdownMenuCheckboxItem for a setting that remains independent of the other items, or DropdownMenuRadioGroup for one choice within the menu.

Anatomy

<DropdownMenu>
  <DropdownMenuTrigger />
  <DropdownMenuContent>
    <DropdownMenuGroup>
      <DropdownMenuLabel />
      <DropdownMenuItem />
    </DropdownMenuGroup>
  </DropdownMenuContent>
</DropdownMenu>

Examples

side=bottom align=center

side=bottom align=end

side=top align=start

side=top align=center

side=top align=end

Installation

  1. Set up your license key before connecting the private registry.

    Connect this project to https://docs.interfacesds.com using the full URL shown below, including {name}. In components.json, add the registries field at the top level. If the field already exists, add only the @interfaces-ds entry inside it. Keep your existing aliases and other registries.

    For a global stylesheet in app/ or src/app/.

    JSON
    {
      "registries": {
        "@interfaces-ds": {
          "url": "https://docs.interfacesds.com/r/{name}.json",
          "headers": {
            "Authorization": "Bearer ${INTERFACES_DS_LICENSE_KEY}"
          }
        }
      }
    }
  2. Install the component.

    Terminal
    npx shadcn@latest add @interfaces-ds/dropdown-menu

    To run the usage example, install these components together.

    Terminal
    npx shadcn@latest add @interfaces-ds/dropdown-menu @interfaces-ds/button

API reference

Import these exports from @/components/ui/dropdown-menu. The tables cover component-specific props and common controls.

DropdownMenu
PropTypeDefault
defaultOpenboolean—
disabledboolean—
modalboolean—
onOpenChange(open: boolean, eventDetails: DropdownMenuPrimitive.Root.ChangeEventDetails) => void—
openboolean—
orientation"horizontal" | "vertical"—
DropdownMenuPortal
PropTypeDefault
forceMounttrue—
keepMountedboolean—
DropdownMenuTrigger
PropTypeDefault
asChildboolean—
disabledboolean—
namestring—
type"button" | "submit" | "reset"—
valuestring | number | readonly string[]—
DropdownMenuContent
PropTypeDefault
forceMounttrue—
DropdownMenuGroup
DropdownMenuLabel
PropTypeDefault
insetboolean—
DropdownMenuItem
PropTypeDefault
asChildboolean—
disabledboolean—
insetboolean—
labelstring—
variant"default" | "danger""default"
DropdownMenuCheckboxItem
PropTypeDefault
asChildboolean—
checkedboolean—
defaultCheckedboolean—
disabledboolean—
labelstring—
onCheckedChange(checked: boolean, eventDetails: DropdownMenuPrimitive.CheckboxItem.ChangeEventDetails) => void—
DropdownMenuRadioGroup
PropTypeDefault
disabledboolean—
onValueChange(value: any, eventDetails: DropdownMenuPrimitive.RadioGroup.ChangeEventDetails) => void—
DropdownMenuRadioItem
PropTypeDefault
asChildboolean—
disabledboolean—
labelstring—
DropdownMenuSeparator
PropTypeDefault
orientation"horizontal" | "vertical"—
DropdownMenuShortcut
DropdownMenuSub
PropTypeDefault
defaultOpenboolean—
disabledboolean—
onOpenChange(open: boolean, eventDetails: DropdownMenuPrimitive.SubmenuRoot.ChangeEventDetails) => void—
openboolean—
orientation"horizontal" | "vertical"—
DropdownMenuSubTrigger
PropTypeDefault
asChildboolean—
disabledboolean—
insetboolean—
labelstring—
DropdownMenuSubContent
PropTypeDefault
forceMounttrue—