Website Header
Website Header components are used to display the header of the website. They are commonly used in websites like Hubtel Web to provide a navigation menu and a logo used to identify the website.
Loading Code Block...Full example
Section titled “Full example”Loading Code Block...Subpages
Section titled “Subpages”Loading Code Block...Webapp
Section titled “Webapp”Loading Code Block...Vue events & slots
Section titled “Vue events & slots”| Props | Default | Type | Description |
|---|---|---|---|
| click:notification | - | () => void | Emitted when the notification bell is clicked. Use this to open a notification panel or navigate to a notifications page. |
| click:cart | - | () => void | Emitted when the cart icon is clicked only when no #cart-drawer-content slot is supplied. If the slot is present, the click opens the internal cart drawer instead and this event is not emitted. |
| Props | Default | Type | Description |
|---|---|---|---|
| #cart-drawer-content | - | Slot | When provided, clicking the cart icon opens a drawer that renders this slot's content. If the slot is empty, the cart icon emits a click:cart event instead. |
| #profile-drawer-content | - | Slot | Optional slot rendered inside the profile drawer that opens when clicking the user avatar. |
| #search-area | - | Slot | Webapp variant only. Vue's equivalent of React's slotContent prop — rendered next to the logo when type='webapp' and the user is authenticated. |
The nav-items prop (navItems in React, navigationItems in Vue) is a discriminated union — pass either link entries or menu (dropdown) entries:
type NavItem = | { type: "link"; label: string; href: string; active?: boolean } | { type: "menu"; label: string; links: Array<{ label: string; href: string }>; active?: boolean; };
// React account shapetype Account = { id: string; name: string; email?: string; avatarImage?: string; isActive?: boolean;};
// Vue account shape — Avatar-shaped directlytype AccountVue = { title?: string; image?: string; subtext?: string;};Webapp specific props
Section titled “Webapp specific props”| Props | Default | Type | Description |
|---|---|---|---|
| slotContent | null | ReactNode | React only. Content rendered next to the logo when type='webapp' and the user is authenticated (commonly a search bar). Vue exposes the same seam as a #search-area named slot. |
Subpages specific props
Section titled “Subpages specific props”| Props | Default | Type | Description |
|---|---|---|---|
| pageTitle | null | string | Page title for subpages type |
Accessibility
Section titled “Accessibility”- The Website Header embeds semantic
<nav>wrappers and structuralaria-labelsrepresenting primary site routing. - The component is built structurally to automatically handle shrinking visibilities where menus collapse into responsive drawer panels, natively passing keyboard-focus traps into the rendered drawers.
- Interactive nested elements (dropdowns inside navigation layers) contain distinct active states and are perfectly usable via strict
Tabtargeting on desktop widths.