Header
Composition-first storefront header shell. Use it when the app needs lower-level control than HeaderSection and wants to assemble promotion, mobile chrome, desktop chrome, optional panels, and the mobile drawer directly.
Best for
Import
import { Header } from "@enadhq/enad-react-sdk/client/storefront"When to use it
Use HeaderSection first when the app wants the fast path for a complete storefront header.
Use Header when the app wants a shared fixed shell and needs lower-level control over the exact chrome anatomy.
Header fits branded storefronts where the useful variations are structural:
- different mobile and desktop action clusters
- different utility link treatments
- optional or branded mega-menu panels
- drawer footer content
- different logo, navigation, and action balance across brands
Composition model
Header is the lower-level composition shell beneath the newer section-first HeaderSection path.
Header is a shell with child regions:
Header.Promotion— top strip region, often used withPromotionBarHeader.Mobile— mobile-only shell regionHeader.Desktop— desktop-only shell regionHeader.Bar— main flex row container for each shell regionHeader.Group— flexible cluster wrapperHeader.Logo— branded anchor regionHeader.NavandHeader.Link— navigation primitives, with keyed desktop panel controls viaownerKey,openPanelOnHover,closePanelOnHover, andclosePanelOnClickHeader.ActionButton— icon/text action buttons or linksHeader.MenuButton— menu trigger wired to the header’s internal drawer stateHeader.Panel— optional desktop panel region for mega menus or editorial nav content, keyed to the owning trigger with the sameownerKeyHeader.Drawer— mobile drawer wrapper tied to the same internal menu state
The root owns:
- fixed positioning
- transparent/default/overlay background behavior
- link color adaptation for overlay/transparent states
- internal mobile drawer open state used by
Header.MenuButtonandHeader.Drawer - internal desktop panel state used by
Header.LinkandHeader.Panel
Behavior and theming guidance
Use variant="default" for solid chrome and variant="transparent" for hero-led pages where the header overlays the page opener until scroll.
Because the header stays fixed, the page body still needs to respect header height with top padding or a spacer.
For desktop mega-menu patterns, open the panel from the owning top-level Header.Link with openPanelOnHover and a stable ownerKey. Match that same ownerKey on the corresponding Header.Panel. Use closePanelOnHover on sibling or utility links so the panel collapses when focus moves away, and use closePanelOnClick on links inside the panel so the expanded header gets out of the way immediately after navigation.
If the app wants a slide-out menu, pair Header.MenuButton with Header.Drawer. The drawer content can include additional utility or branded content at the bottom.
Practical guidance
- Put navigation and utility structure in child slots
- Use
Header.Panelfor desktop-only mega-menu or editorial nav content - Give each hover-owned desktop panel a stable
ownerKey, and reuse that key on both the openingHeader.Linkand the matchingHeader.Panel - Use
Header.Linkdesktop panel controls to decide which top-level links open the mega menu and which links collapse it - Add
closePanelOnClickto mega-menu destination links so the header collapses as soon as navigation starts - Use
Header.Drawerfor mobile navigation and auxiliary drawer content - Keep
PromotionBaras a separate component and decide explicitly whether it belongs insideHeader.Promotion
If the app does not need a promotion strip or a desktop panel, simply omit those regions.
Examples
Live examples you can edit directly in the sandbox.
Composed storefront header
Assemble the shell from child slots so each storefront can control structure without forking the component itself.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | string | "default" | Visual style of the header background |
| children | string | — | Composition-first header content assembled from child slots such as `Header.Promotion`, `Header.Mobile`, `Header.Desktop`, and `Header.Drawer` |
| labels | string | — | Accessible labels for header icon buttons and mobile drawer helpers |
| className | string | — | No description yet. |