Skip to content
caliper ui docs

Blocks

Site header

A top navigation bar with logo, links and actions.

Pro
pnpm dlx shadcn@latest add @caliper/site-header
Skip to content

Customer story · Ostra Freight

Closing September in two days, not nine

Scroll this page: the header stays put and tightens once you leave the top.

Sailboats in a harbour at dusk

Ostra moved 4,210 monthly bank lines onto Halden in a week. Matching now runs overnight, and the finance team spends the first morning of the close on exceptions only.

Installs components/ui/site-header.tsxDepends on @radix-ui/react-popover, @radix-ui/react-slot, lucide-reactMotion none in component source

When to use

Use it for

  • The top of a public website.

Skip it when

  • An application with a sidebar.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/site-header

Adds its 5 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { SiteHeader } from "@/components/ui/site-header"

The worked example comes with Pro

The 55-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

SiteHeader

component
PropTypeDefaultDescription
brand *ReactNode—
links *readonly SiteLink[]—
actionsReactNode—Sign in, a primary button, a theme switch.
skipTostring"#main"Adds a first-focus "Skip to content" link. Pass an empty string to omit it.
stickybooleantrue
scrollRootRefObject<HTMLElement | null>—An element that scrolls instead of the window, to show the border when it is scrolled.
classNamestring—

Accessibility

It is built on native elements and keeps aria-label, aria-hidden, aria-current, aria-expanded and aria-controls in step with state.

KeyBehaviour
EscapeCloses or cancels, then returns focus to where it came from.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Page chrome examples