Skip to content

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...
Loading Code Block...
Loading Code Block...
Loading Code Block...

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 shape
type Account = {
id: string;
name: string;
email?: string;
avatarImage?: string;
isActive?: boolean;
};
// Vue account shape — Avatar-shaped directly
type AccountVue = {
title?: string;
image?: string;
subtext?: string;
};
PropsDefaultTypeDescription
slotContentnullReactNodeReact 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.
PropsDefaultTypeDescription
pageTitlenullstringPage title for subpages type
  • The Website Header embeds semantic <nav> wrappers and structural aria-labels representing 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 Tab targeting on desktop widths.