NavigationNew
Glass Header
A floating glass header with a brand, navigation links, actions and a compact menu.
Preview
Demos ready. Update 0.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-headerAdds 13 files to components/glassyui and installs clsx.
Usage
Usage
import { GlassHeader } from "@/components/glassyui/glass-header";
import { GlassButton } from "@/components/glassyui/glass-button";
export function Header() {
return (
<GlassHeader
brand={<a href="/">Acme</a>}
actions={
<GlassButton asChild size="sm" variant="prominent">
<a href="/start">Get started</a>
</GlassButton>
}
>
<a href="/features">Features</a>
<a href="/pricing">Pricing</a>
<a href="/docs">Docs</a>
</GlassHeader>
);
}Examples
Inside a layout
<GlassHeader brand={<a href="/">Acme</a>} position="static">
<a href="/features">Features</a>
<a href="/pricing" aria-current="page">Pricing</a>
</GlassHeader>API reference
GlassHeader
A header element with a nav for its links.
| Prop | Type | Default | Description |
|---|---|---|---|
brandRequired | ReactNode | None | Logo or wordmark, usually linked to the home page. |
children | ReactNode | None | Navigation links. They render twice, in the inline nav and in the Menu used below 780px of header width, so avoid ids inside them. |
actions | ReactNode | None | Buttons or links at the end, shown at every width. |
position | 'fixed' | 'static' | 'fixed' | fixed floats 14px from the top (8px on narrow screens) and needs about 84px of room above your content; static stays in the layout. |
condenseOnScroll | boolean | false | Starts as a full-width bar without glass and condenses into the capsule after 8px of scroll. Fixed headers only. |
navigationLabel | string | 'Primary' | Accessible name for both navs. |
Also accepts HTML header attributes.
- Types
GlassHeaderProps- Accessibility
- Give each header a unique navigationLabel when a page has more than one.