Header Menu
Renders a list of menus as either a horizontal list of NavLink components or a vertical SidebarMenu in mobile mode
- Import
import { HeaderMenu } from '@smile/haring-react'; - Source View Source Code
- Package @smile/haring-react
- Storybook Storybook
Storybook Docs
Props
| Name | Type | Default | Description |
|---|---|---|---|
| menus | IHeaderMenuMenu<T>[] | - | Array of menu objets to be rendered in vertical or horizontal lists |
| isMobile | boolean | false | Determines if the menus will be displayed as a horizontal list of NavLink components (desktop) or as a vertical SidebarMenu (mobile) |
| navLinkComponent | ElementType | "a" | Type of Element tag used for the NavLink components |
IHeaderMenuMenu
IHeaderMenuMenu has a generic T that extend of number | string and it extend of IMenuItem<T>
| Name | Type | Description |
|---|---|---|
| children | IHeaderMenuMenu<T>[] | Object array to be rendered in a header sub-menu |
| url | string | the url of the navigation link |