GitHub

Site Header

Website header with navigation

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { SiteHeader } from "@corew500/ui/site-header"

<SiteHeader>Content</SiteHeader>

Variants

siteHeaderVariants

AxisValuesDefault
variant
defaultsolidtransparent
default

API Reference

Props

PropTypeDefaultDescription
logoenumLogo element or component
logoHrefstring/URL for logo link (defaults to "/")
navigationNavItem[][]Navigation items
actionsenumActions to show on the right side (buttons, etc.)
mobileMenuContentenumCustom content for mobile menu (replaces default nav rendering)
stickyenumfalseMake header sticky @deprecated Use `position="sticky"` instead
positionenum"sticky" when `sticky` is true, otherwise "static"Header positioning behavior. "fixed" removes from document flow.
responsiveHeightenumfalseEnable taller header on larger screens (h-16 → sm:h-20)
skipToContentIdstring"main-content"ID of the main content element for skip-to-content link
skipToContentLabelstring"Skip to content"Label for skip-to-content link
fullWidthenumfalseUse full viewport width instead of container max-width
linkComponentenumLink component to use for navigation (defaults to anchor)
openMenuLabelstringOpen menuAccessible label for the mobile menu button when closed (pre-translated).
closeMenuLabelstringClose menuAccessible label for the mobile menu button when open (pre-translated).
mobileMenuTitlestringNavigation MenuScreen-reader-only title for the mobile menu sheet (pre-translated).
mobileMenuDescriptionstringSite navigation linksScreen-reader-only description for the mobile menu sheet (pre-translated).
variantenum

Accessibility

Keyboard Navigation

  • Keyboard accessible navigation and menu toggle

Screen Readers

  • Mobile menu button has aria-label and aria-expanded
  • Menu icons use aria-hidden="true"
  • Sheet has sr-only title and description for screen readers

Additional

  • - Uses semantic <header> element
  • Navigation uses proper list and link semantics

Localization

Translatable Content

  • - All text content flows through navigation prop
  • NavItem labels and descriptions should be pre-translated
  • Mobile menu button labels accept `openMenuLabel` and `closeMenuLabel` props (defaults to English)

Related