Skip to content

Dropdown Menu

An enterprise-level dropdown menu component based on BrConfigProvider for global theme configuration. It supports multiple directions, nested submenus, and custom trigger methods.

Component Features

  • 🛠️ Multi-direction Popover: Supports popping out from top, bottom, left, and right directions, auto-adjusting to fit screen edges.
  • 📋 Nested Submenus: Supports infinite levels of nested submenus, suitable for complex hierarchical structures.
  • ⌨️ Shortcuts Support: Allows configuring shortcut keys for menu items to enhance keyboard operation experience.
  • 🖱️ Multiple Triggers: Supports various trigger methods such as click, hover, and contextmenu.
  • 🎨 Theme Customization: Supports global theme customization based on BrConfigProvider, and local style overrides via TailwindCSS.

Basic Usage

The most basic dropdown menu display.

Example

Position

Supports align and side properties to control the pop-up position, supporting 12 different directions.

Example

Complex Example

A complex application scenario combining icons, shortcuts, separators, nested submenus, disabled states, custom styles (like red highlight for destructive actions).

Example

Nested Submenus and Shortcuts

Supports multi-level nested submenus and configuring keyboard shortcuts via the shortcut prop.

Example

Custom Trigger Methods (Hover/ContextMenu)

Supports click, hover, and contextmenu trigger methods, which can be configured via the trigger prop.

Right-click in this area
Example

Form Integration

Typical application in form operations or table row actions.

Example

Theme Customization

Combined with BrConfigProvider, you can globally override the default styles of the component, such as modifying border radius, hover state colors, menu shadows, etc. At the same time, styles can be overridden locally via TailwindCSS.

Example

API Reference

BrDropdownMenu

PropTypeDefaultDescription
open (v-model)boolean-Controls the open state of the menu
defaultOpenbooleanfalseDefault open state
dir'ltr' | 'rtl''ltr'Text reading direction
trigger'click' | 'hover' | 'contextmenu' | Array'click'Trigger method configuration
openDelaynumber200Open delay in ms when hover triggered
closeDelaynumber300Close delay in ms when hover triggered

BrDropdownMenuContent

PropTypeDefaultDescription
classany-Custom class name
side'top' | 'right' | 'bottom' | 'left''bottom'The preferred side of the menu to render against
sideOffsetnumber4The distance in pixels from the trigger
align'start' | 'center' | 'end''center'The preferred alignment against the trigger
alignOffsetnumber0Alignment offset

BrDropdownMenuItem

PropTypeDefaultDescription
disabledbooleanfalseWhether the item is disabled
shortcutstring-Shortcut text (e.g. "⌘K")
insetbooleanfalseWhether to include left indentation (for icon alignment)

BrDropdownMenuSub

Root container for nested submenus, no additional props required.

BrDropdownMenuEmpty / BrDropdownMenuLoading

Used to display empty or loading states.

PropTypeDefaultDescription
textstring'No data' / 'Loading...'Prompt text