NOCTA UI

Dropdown Menu

A dropdown menu component triggered with a standard click, featuring separators, submenus, and disabled states

Installation

Install the Dropdown Menu component using the nocta-ui CLI:

npx nocta-ui add dropdown-menu

Import the component:

import {
  DropdownMenu,
  DropdownMenuTrigger,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuSeparator,
} from '@/components/ui/dropdown-menu';

Examples

Simple Dropdown Menu

With Separators

Use DropdownMenuSeparator to group related menu items.

With Submenu

Create nested menus using DropdownMenuSub, DropdownMenuSubTrigger, and DropdownMenuSubContent.

Disabled State

Both the entire dropdown menu and individual items can be disabled.

API Reference

PropTypeDefaultDescription
childrenReact.ReactNodeThe trigger and content components
classNamestringAdditional CSS classes
PropTypeDefaultDescription
childrenReact.ReactNodeContent that toggles the menu on click
disabledbooleanfalseDisable the dropdown trigger
classNamestringAdditional CSS classes
PropTypeDefaultDescription
childrenReact.ReactNodeMenu items and separators
classNamestringAdditional CSS classes
size'sm' | 'md' | 'lg''md'Content padding and min-width
PropTypeDefaultDescription
childrenReact.ReactNodeItem content
disabledbooleanfalseDisable the item
insetbooleanfalseIndent the item content
destructivebooleanfalseApply destructive styling
classNamestringAdditional CSS classes
onClick() => voidClick handler
PropTypeDefaultDescription
classNamestringAdditional CSS classes
PropTypeDefaultDescription
childrenReact.ReactNodeSubmenu trigger and content
PropTypeDefaultDescription
childrenReact.ReactNodeSubmenu trigger content
disabledbooleanfalseDisable the submenu trigger
insetbooleanfalseIndent the trigger content
destructivebooleanfalseDestructive styling (not typical)
classNamestringAdditional CSS classes
PropTypeDefaultDescription
childrenReact.ReactNodeSubmenu items and separators
classNamestringAdditional CSS classes
size'sm' | 'md' | 'lg''md'Content padding and min-width