HeaderSection
Section-first storefront header that now supports both a fast prop-driven setup and a composition-first family surface built on the public navigation primitives.
Best for
Import
import { HeaderSection } from "@enadhq/enad-react-sdk/client/storefront"When to use it
Use HeaderSection when the storefront wants a single supported section API for the global header but still needs a real escape hatch into composition.
It is the right starting point when the page needs:
- a complete top shell quickly
- promo, utility, primary nav, actions, and mobile navigation in one supported family
- benchmark-style variation without forking the section
- an upgrade path that stays inside the public navigation primitives
Preferred usage now
HeaderSection now has two public modes:
Preferred: child slots
Use the compound family when the app wants to explicitly arrange the section regions.
HeaderSection.PromotionHeaderSection.MobileHeaderSection.DesktopHeaderSection.UtilityHeaderSection.MainHeaderSection.LogoHeaderSection.PrimaryNavHeaderSection.ActionsHeaderSection.MegaMenuHeaderSection.MobilePanelHeaderSection.MobileFooter
Convenience path: structured props
The original prop API still works:
promoutilityprimaryNavfeaturedactionsmobileNav
Treat that prop surface as the fast path, not the long-term composition ceiling.
Family ownership map
HeaderSection is a section-first wrapper built on the public family layer.
- promo zone →
PromotionBar - shell zone →
StoreHeader - utility zone →
UtilityNav - primary navigation zone →
PrimaryNav - featured desktop panel zone →
MegaMenu - mobile navigation zone →
MobileNav/MobileMenuDrawer
That ownership map is still the point of the component. It is a useful section, not a black-box template.
Easy path and open path
The easy path is the structured prop API:
promoutilityprimaryNavfeaturedactionsmobileNav
Inside primaryNav.items, the preferred keyed model is:
id— stable ownership key for the nav itemtrigger— desktop trigger label/href overridespanel— desktop mega-menu categories and featured itemsmobile— mobile drawer label/href/children overrides
For migration, HeaderSection still accepts the legacy flat NavItem fields href, label, megaMenuCategories, and megaMenuFeatured and maps them forward into the keyed model.
The open path is selective replacement.
Right now the strongest explicit seam is the featured mega-menu region through featured.content. That lets the app swap one major zone while keeping the rest of the section intact.
The promo region is intentionally narrower today. If the top strip needs richer campaign hierarchy, multiple support lines, or a stronger CTA treatment, drop to StoreHeader.Promotion instead of overloading HeaderSection.promo.
Behavior and theming guidance
HeaderSection should be the first answer for most storefront-header questions because it keeps the navigation family visible while staying fast to adopt.
Lead with the keyed nav branches for all new examples and app code. Treat the flat legacy fields as migration-only compatibility, not the preferred authoring shape.
Use it to prove different navigation rhythms through content and component-set shifts:
- promo-heavy commerce
- campaign-led browse flow
- restrained editorial chrome
Use variant="transparent" or variant="overlay" for hero-led openings and variant="default" for standard content and catalog pages.
Use the composition-first path when:
- desktop and mobile structure should diverge more clearly
- the mega-menu region wants editorial or campaign content
- the mobile drawer needs a branded closing section
- the app wants to keep the section abstraction but own the section order directly
If the page grows beyond the section contract entirely, drop to StoreHeader and the lower-level family directly instead of overloading HeaderSection.
Examples
Live examples you can edit directly in the sandbox.
Composition-first header section
Prefer the child-slot surface when the storefront wants to keep the section contract but arrange promotion, utility, desktop chrome, and mobile drawer content explicitly.
Convenience props still supported
Use the structured prop API when the default shell is already close and the app only needs a fast setup path.
Featured-region override seam
Override the featured mega-menu region without abandoning the rest of the section structure.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | — | Composition-first header section assembled from child slots such as `HeaderSection.Promotion`, `HeaderSection.Utility`, `HeaderSection.Main`, and `HeaderSection.MegaMenu` |
| variant | string | — | No description yet. |
| logo | string | — | No description yet. |
| logoHref | string | — | No description yet. |
| promo | string | — | No description yet. |
| utility | string | — | No description yet. |
| primaryNav | string | — | No description yet. |
| featured | string | — | No description yet. |
| actions | string | — | No description yet. |
| mobileNav | string | — | No description yet. |
| labels | string | — | No description yet. |
| className | string | — | No description yet. |