Navbar
Navbar component with a brand, links, actions and a responsive mobile menu.
How to use it
Run npx @blossomui/react add navbar, or copy src/components/UI/Navbar/Navbar.tsx into your React project and import it.
import { Navbar } from './components/ui/Navbar'Props
NavbarLink
| Prop | Type | Description |
|---|---|---|
| label (required) | string | |
| href (required) | string | |
| active | boolean | Marks the link of the page that is open. |
NavbarProps
| Prop | Type | Description |
|---|---|---|
| className | string | Extra classes for the bar, for example to change the offset when it is sticky. |
| labels | { navigation?: string; openMenu?: string; closeMenu?: string } | Texts of the component. Pass only the ones you want to change, for example to translate it. |
| color | string | Accent color of this component: any CSS color. Without it the component uses `--blossom-accent`, which is pink by default. |
| brand (required) | ReactNode | |
| links (required) | NavbarLink[] | |
| actions | ReactNode | Buttons shown at the right on a wide screen. On a narrow one they move inside the menu. |
| alwaysVisibleActions | ReactNode | Buttons that stay in the bar at every width, for example the cart. |
| breakpoint | number | Width in pixels under which the links and `actions` collapse into the menu button. |
| sticky | boolean | Keep the bar at the top while the page scrolls. |