Structural primitives for a site header: the header bar itself, a centered container, and groups for clustering navigation, logos, and actions.
Install
pnpm dlx shadcn@latest add https://sitex.full.dev/r/header.jsonUsage
import { Header, HeaderContainer, HeaderGroup } from "@/components/ui/header"
export function SiteHeader() {
return (
<Header variant="floating">
<HeaderContainer>
<HeaderGroup>
<a href="/">Acme</a>
</HeaderGroup>
<HeaderGroup className="ml-auto">
<a href="/docs">Docs</a>
<a href="/pricing">Pricing</a>
</HeaderGroup>
</HeaderContainer>
</Header>
)
}Key parts:
Headerrenders aheaderelement with two variants:default(plain full-width bar) andfloating(rounded, bordered, centered card that respects the--containerCSS variable).HeaderContainercenters content with amax-w-7xlcontainer and horizontal padding.HeaderGroupis a flex row for clustering items; useclassName="ml-auto"to push a group to the far side.headerVariantsis exported for reusing the variant classes elsewhere.
All parts are static and render without a client directive; add one only if you place interactive islands inside.