Skip to main content

Header

A versatile header component with support for sticky positioning, mobile responsiveness, and various navigation elements.

Component Preview

Props

PropTypeDescription
menuBarReactNode[]Array of navigation items (e.g., MenuItem, Dropdown).
utilityButtonsReactNode[]Array of utility items (e.g., icons, buttons).
stickybooleanWhether the header sticks to the top. Default: false.
mobileBreakpointnumberWidth in pixels to switch to mobile view. Default: 768.
imageSrcstringURL for the logo image.
logoHrefstringURL the logo links to.
logoTargetstringTarget for the logo link. Default: '_self'.
altTextstringAlt text for the logo. Default: 'Logo'.
classNamestringOptional CSS class name for the wrapper.
logoClassNamestringOptional CSS class for the logo anchor.
invertedbooleanWhether to use inverted theme colors. Default: false.

JSON Data Example

{
"type": "Header",
"data": {
"id": "header-default",
"sticky": false,
"className": "bg-primary shadow-md",
"mobileBreakpoint": 768,
"logoHref": "/",
"imageSrc": "/logo.svg",
"logoClassName": "w-[84px]",
"altText": "Company Logo",
"children": [
{
"type": "Dropdown",
"data": {
"id": "dropdown-default",
"title": "Products",
"className": "bg-primary hover:bg-primary-200 text-primary-950 rounded-sm px-4 py-2",
"itemGroupClassName": "bg-primary text-primary-950 p-4",
"icon": "mdi:apps"
},
"children": [
{
"type": "MenuGrid",
"data": {
"id": "menugrid-default",
"columns": 3,
"className": "rounded-sm shadow-md",
"gridClassName": "gap-6 bg-primary text-primary-950 rounded-sm px-4 py-2 shadow-md w-148"
}
}
]
},
{
"type": "IconButton",
"data": {
"id": "sticky-cart",
"icon": "mdi:cart",
"onClick": "@action:onCartClick",
"data-position": "far-item",
"className": "bg-primary hover:bg-primary-200 text-primary-950 rounded-sm px-4 py-2"
}
}
]
}
}