Basic Usage
Component Structure
Navigation Menu Root
Groups all parts of the navigation menu:Navigation Menu Item
Individual navigation items:Navigation Menu Trigger
Button that opens the popup:Navigation Menu Content
Container for the menu content:Navigation Menu Link
Link items within the menu:Props Reference
Root Props
The controlled value of the item that should be currently open
The uncontrolled value of the item initially selected
Callback fired when the value changes
The orientation of the navigation menu
How long to wait before opening the navigation menu in milliseconds
How long to wait before closing the navigation menu in milliseconds
Item Props
Unique value identifying this item
Trigger Props
Whether the component should ignore user interaction
Content Props
Whether to keep the HTML element in the DOM while the content is hidden
Link Props
Whether this link is currently active
Positioning Props
Which side of the anchor to align the content against
How to align the popup relative to the specified side
Distance between the anchor and the content in pixels
Whether to maintain the content in the viewport after scrolling
Styling
From source code atreflex_ui/components/base/navigation_menu.py:19-34:
- Root has rounded corners and secondary background
- List uses flex layout with minimal width
- Trigger includes hover and active states with focus ring
- Content has smooth transitions with activation direction support
- Link items have hover states and focus rings
Implementation Details
From source code atreflex_ui/components/base/navigation_menu.py:48-82:
- Built on accessible navigation patterns
- Supports keyboard navigation with arrow keys
- Automatic focus management
- Smooth animations with configurable delays
- Portal support for proper z-index layering