Menu
A menu component based on BrConfigProvider global theme configuration, replicating the shadcn-vue design system. It supports multi-level nesting, shortcut annotations, and keyboard navigation. This component is primarily used to implement context menus (Right-click Context Menu).
Component Features
- 🎨 Theme Adaptation: Deeply integrated with
BrConfigProvider, supporting CSS variables to configure background, foreground, radius, shadow, etc. - 📋 Multi-level Nesting: Supports infinite levels of nested submenus.
- ⌨️ Keyboard Navigation: Full support for Tab, Arrow Up/Down/Left/Right, Enter, Esc key operations.
- ⌨️ Shortcuts: Supports shortcut key annotations for menu items.
- 📦 Group Dividers: Supports menu groups and separator lines.
- 🎯 Collision Detection: Automatically adjusts the pop-up position to prevent overflowing the viewport.
Basic Usage
The simplest context menu containing a few basic operations.
Complex Menu
A complex context menu supporting groups, icons, shortcuts, and multi-level nesting, as shown in the preview.
Nested Submenus
Support creating multi-level submenus using BrMenuSub.
Shortcut Annotations
Use the shortcut slot or property to display keyboard shortcuts.
Theming
BrMenu uses CSS variables from BrConfigProvider for style customization.
Configure global styles through the theme property of BrConfigProvider: