Live Examples
HTML Structure
<details data-variant="popover">
<summary>Menu</summary>
<nav role="navigation" aria-label="Menu options">
<a href="#">Option 1</a>
<a href="#">Option 2</a>
<button type="button">Action</button>
</nav>
</details>
Data Attributes
- `data-variant="popover"` - Marks details element as popover menu
ARIA Attributes
- `role="navigation"` - Menu content is navigation region
- `aria-label` - Describes menu purpose to screen readers
Key Features
- Native Details Element - Uses semantic HTML5 `` and `
`
- Positioned Menu - Navigation appears below trigger
- Link and Button Support - Mix of links, buttons, and separators
- Keyboard Navigation - Space/Enter to toggle, Tab through items
- Auto-close - Closes when clicking outside or selecting item
- Accessibility - Full ARIA and screen reader support
- Visual Feedback - Hover and focus states on all items
Use Cases
- Dropdown Menus - File menu, action menu, main navigation
- User Menu - Profile, settings, logout options
- Action Menus - Edit, delete, share, archive actions
- Contextual Panels - Help text, additional options, metadata
- Language/Theme Switcher - Multiple option selection
- Filters - Filter options for data lists
Keyboard Navigation
- Space / Enter - Toggle popover open/closed on summary
- Tab - Navigate through menu items
- Escape - Close popover (handled by axiom.js)
- Click Outside - Close popover (handled by axiom.js)
Best Practices
- Clear Triggers - Make summary text clearly indicate it's clickable
- Grouped Items - Use `
` to separate different action types - Semantic Elements - Use `` for navigation, `
- Proper Labels - Use aria-label to describe menu purpose
- Keyboard Support - All items fully keyboard accessible
- Mobile Friendly - Works well with touch on mobile devices
- Focus Management - Proper focus indicators for keyboard users
Features
- Semantic Structure - Built with native HTML5 elements for maximum reliability.
- Theme Aware - Automatically adapts to all 22 Axiom01 themes via OKLCH tokens.
- Fully Responsive - Scales perfectly from mobile to desktop screens.
- No JS Dependency - Core functionality relies on pure CSS for maximum performance.
- Customizable - Easily extendable via Axiom01's design tokens and modifiers.
Accessibility
Axiom01 ensures that the Popover component meets strict WCAG standards out of the box:
- Keyboard Navigation - Fully navigable using standard Tab and Arrow key workflows.
- Screen Reader Support - Requires minimal manual ARIA labeling due to semantic HTML roots.
- Focus Management - Visible, high-contrast focus indicators without layout shifting.
- Color Contrast - OKLCH math guarantees perfect WCAG AAA contrast ratios in both light and dark modes.
- Reduced Motion - Respects system-level
prefers-reduced-motionsettings for any internal animations.