Skip to content
caliper ui docs

Pro

Condensing header

A page header that makes room as you read: the title shrinks into a bar, the description folds away and a border appears, following the scroll.

Pro
pnpm dlx shadcn@latest add @caliper/condensing-header

Invoices

128 this year · €412,300 billed · 6 overdue
  • INV-2041Northwind€1,240
  • INV-2040Ostra Freight€1,555
  • INV-2039Halberd€1,870
  • INV-2038Taberna da Rua€2,185
  • INV-2037Kestrel Labs€2,500
  • INV-2036Brightline€2,815
  • INV-2035Northwind€3,130
  • INV-2034Ostra Freight€3,445
  • INV-2033Halberd€3,760
  • INV-2032Taberna da Rua€4,075
  • INV-2031Kestrel Labs€4,390
  • INV-2030Brightline€4,705
  • INV-2029Northwind€5,020
  • INV-2028Ostra Freight€5,335
  • INV-2027Halberd€5,650
  • INV-2026Taberna da Rua€5,965
  • INV-2025Kestrel Labs€6,280
  • INV-2024Brightline€6,595
Installs components/ui/condensing-header.tsxDepends on none beyond ReactMotion honours reduced motion

When to use

Use it for

  • Long settings, record and list pages.
  • Phone screens where vertical space is short.

Skip it when

  • Short pages that never scroll.

Installation

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

Adds its 2 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 { CondensingHeader } from "@/components/ui/condensing-header"

The worked example comes with Pro

The 26-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

CondensingHeader

component
PropTypeDefaultDescription
title *string—
descriptionReactNode—
actionsReactNode—
distancenumber72Pixels of scroll over which it condenses.
scrollRootRefObject<HTMLElement | null>—The element that scrolls, if not the window.
classNamestring—

Accessibility

It is built on native elements, so roles and focus come from the browser.

No custom key handling; Tab and the native activation keys do the work.

Motion

It checks prefers-reduced-motion itself and settles immediately instead of travelling. Every state is still reachable.

All Surfaces examples