Browse docsHeader

NavigationNew

Glass Header

A floating glass capsule with a brand, navigation links and actions.

pnpm dlx shadcn@4.14.1 add @glassyui/glass-header

Preview

Demos ready. Update 0.

Installation

First add the exact @glassyui mapping to components.json as shown in Getting Started. Then run the pinned item command:

Install Glass Header

pnpm dlx shadcn@4.14.1 add @glassyui/glass-header
What this installs11 files, 1 package

Direct registry declarations

These values belong to @glassyui/glass-header itself in registry.json.

Package dependencies

  • clsx

Registry dependencies

  • @glassyui/glass-surface

File targets

  • components/glassyui/glass-header.tsx
  • components/glassyui/styles/header.css

Complete installed closure

This follows every namespaced registry dependency recursively and de-duplicates the packages and target files installed with this item.

Package dependencies

  • clsx

Installed files

  • components/glassyui/glass-header.tsx
  • components/glassyui/styles/header.css
  • components/glassyui/glass-surface.tsx
  • components/glassyui/lib/merge-refs.ts
  • components/glassyui/lib/refraction-map.ts
  • components/glassyui/lib/use-refraction-filter.tsx
  • components/glassyui/lib/scene-context.ts
  • components/glassyui/glass-provider.tsx
  • components/glassyui/liquid-filters.tsx
  • components/glassyui/lib/preferences.ts
  • components/glassyui/styles/liquid.css

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

GlassHeader

A semantic header with a ref to its header element.

GlassHeaderProps

Native header attributes plus brand, actions and placement.

brand

A logo or wordmark, usually linked to the home page.

children

Navigation links. The same links appear in the mobile menu.

actions

Buttons or links on the right, visible at every width.

position

"fixed" (default) floats 14px from the top; "static" stays in the surrounding layout.

navigationLabel

Accessible name for the navigation, "Primary" by default.

Notes

The action button

Actions can be any buttons or links. The usage example uses Glass Button; install it with `pnpm dlx shadcn@4.14.1 add @glassyui/glass-button`.

Make room for the header

The fixed capsule is 56px tall and up to 920px wide. Leave at least 84px above your page content.

A menu when space is tight

Below 760px of available width, the links move into a Menu disclosure. Escape closes the menu and returns focus; choosing a link also closes it. Supply links as children, with unique navigationLabel values when a page contains multiple headers.

Shared glass preferences

The header follows GlassProvider theme, thickness and reduced transparency preferences. Its glass uses the existing surface renderer.

Accessibility

Keep the Radix-backed semantics intact and preserve visible labels, focus states, and keyboard operation when copying the source.

Performance

Use provider quality preferences for dense app screens. Reserve strong refraction for hero or showcase surfaces.