Navigation menu
Navigation menu component with mega menu panels of grouped links, featured blocks and keyboard navigation.
How to use it
Run npx @blossomui/react add navigation-menu, or copy src/components/UI/NavigationMenu/NavigationMenu.tsx into your React project and import it.
import { NavigationMenu } from './components/ui/NavigationMenu'
Props
NavigationLink
| Prop | Type | Description |
|---|
| label (required) | string | |
| description | string | Small text under the label. |
| href (required) | string | |
| icon | ReactNode | |
NavigationGroup
| Prop | Type | Description |
|---|
| title | string | Title of the column. |
| links (required) | NavigationLink[] | |
NavigationItem
| Prop | Type | Description |
|---|
| id (required) | string | |
| label (required) | string | |
| href | string | Makes the item a plain link, without a panel. |
| groups | NavigationGroup[] | Columns of links shown in the panel. |
| featured | ReactNode | Anything you want in the panel, for example a featured card. It is shown before the columns. |
NavigationMenuProps
| Prop | Type | Description |
|---|
| items (required) | NavigationItem[] | |
| activeId | string | Id of the item that is the current page. |
| hoverDelay | number | Milliseconds to wait before opening a panel on hover, so crossing the bar does not flash the panels. |
| color | string | Accent color of the active item: any CSS color. Without it the component uses `--blossom-accent`. |
| label | string | Accessible name of the navigation. |
| className | string | |