2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Components

NavIcon

Updated: May 11, 2025
View on GitHub
A simple yet effective component for creating hamburger menu icons that can toggle between active and inactive states. NavIcon is commonly used in responsive navigation interfaces to indicate the presence of a menu. NavIcon has two states: active and inactive, controlled by the active prop. The NavIcon component accepts all the props of the Flex component, allowing for customization of size, spacing, and other properties.
Prop
Type
Default
className
string
style
React.CSSProperties
onClick
Called on press.
() => void
active
Whether the menu is open. Drives which way the bars animate.
boolean
…and every FlexProps propinherited
The NavIcon component includes a tabIndex={0} by default, making it keyboard accessible. When implementing NavIcon in your application, consider the following accessibility best practices:
  • Add an aria-label or aria-labelledby attribute to describe the purpose of the button
  • Use aria-expanded to indicate the current state of the menu it controls
  • Ensure the menu that is toggled by the NavIcon is properly accessible
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club