Overview
Hux UI provides a comprehensive context menu system with smart positioning and cross-platform support:- HuxContextMenu - Main wrapper widget with smart positioning
- HuxContextMenuItem - Individual menu items with icons and states
- HuxContextMenuDivider - Visual separators for menu groups

Component Variants
Basic Context Menu
Simple context menu with basic actions:Context Menu with Dividers
Organized menu with visual separators:Context Menu with Disabled Items
Menu with disabled and destructive actions:File Context Menu
Context menu for file operations:Basic Usage
Features
- Smart Positioning - Automatic menu positioning to prevent screen overflow
- Cross-Platform - Works on desktop, mobile, and web
- Web Optimization - Proper browser context menu prevention
- Consistent Design - Follows Hux UI design system
- Theme Aware - Adapts to light and dark themes
Components
HuxContextMenu
Main wrapper that handles context menu display and positioning. Properties:menuItems- List of menu items and dividerschild- Widget that triggers the context menu
HuxContextMenuItem
Individual menu item with icon, text, and interaction handling. Properties:text- Menu item labelicon- Optional icon (FeatherIcons recommended)onTap- Action callbackisDisabled- Whether the item is disabledisDestructive- Whether the item represents a destructive action
HuxContextMenuDivider
Visual separator for organizing menu items into groups.Advanced Example
Platform Support
- Desktop - Right-click support with proper positioning
- Mobile - Long-press gesture support
- Web - Proper browser context menu prevention
Context menus automatically prevent the browser’s default context menu on web platforms using the universal_html package.
Examples
File Manager
See context menus in a file management interface
Text Editor
Learn how to implement editor context menus