Skip to content
caliper ui docs

Components

Scroll area

A labelled, keyboard-focusable scroll region with a quiet scrollbar.

Free
pnpm dlx shadcn@latest add @caliper/scroll-area

Deploys · halden-web

8 today · all from main · 0 failed

  • Faster cold starts in eu-central-1#1240 · Priya Nair2m
  • Retry webhooks with backoff#1239 · Elias Kim18m
  • Export the audit log as CSV#1238 · Lena Fischer41m
  • Fix the invoice PDF footer#1237 · Kofi Mensah1h
  • Bump the Postgres driver#1236 · Priya Nair2h
  • Seat changes prorate to the day#1235 · Sofia Ortega3h
  • Cache plan limits per workspace#1234 · Elias Kim4h
  • Remove the old billing banner#1233 · Lena Fischer5h
Installs components/ui/scroll-area.tsxDepends on none beyond ReactMotion none in component source

When to use

Use it for

  • Fixed-height panels with long lists, like activity.
  • Regions that must be reachable with the keyboard.

Skip it when

  • The whole page scrolls; use the page.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/scroll-area

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

This is the code behind the preview above.

example.tsx
import { type ReactNode } from "react"
import { Avatar } from "@/components/ui/avatar"
import { ScrollArea } from "@/components/ui/scroll-area"
import { cn } from "@/components/ui/lib/cn"

function Panel({ title, context, media, action, className, children }: { title: string; context: string; media?: ReactNode; action?: ReactNode; className?: string; children?: ReactNode }) {
  return (
    <section className={cn("grid w-full max-w-md gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting", className)}>
      <div className="flex items-center gap-3">
        {media}
        <div className="grid min-w-0 flex-1 gap-1">
          <p className="font-medium">{title}</p>
          <p className="text-sm text-muted-foreground">{context}</p>
        </div>
        {action}
      </div>
      {children}
    </section>
  );
}

const deploys = [
  ["Priya Nair", "Faster cold starts in eu-central-1", "2m"],
  ["Elias Kim", "Retry webhooks with backoff", "18m"],
  ["Lena Fischer", "Export the audit log as CSV", "41m"],
  ["Kofi Mensah", "Fix the invoice PDF footer", "1h"],
  ["Priya Nair", "Bump the Postgres driver", "2h"],
  ["Sofia Ortega", "Seat changes prorate to the day", "3h"],
  ["Elias Kim", "Cache plan limits per workspace", "4h"],
  ["Lena Fischer", "Remove the old billing banner", "5h"],
] as const;

export function ActivityList() {
  return (
    <Panel title="Deploys · halden-web" context="8 today · all from main · 0 failed">
      <ScrollArea label="Activity" className="-mx-2 max-h-56">
        <ul className="grid">
          {deploys.map(([person, message, ago], index) => (
            <li key={message} className="flex items-center gap-3 px-2 py-2.5 text-sm">
              <Avatar name={person} alt="" className="size-7" />
              <span className="grid min-w-0 flex-1">
                <span className="truncate font-medium">{message}</span>
                <span className="text-xs text-muted-foreground">#{1240 - index} · {person}</span>
              </span>
              <span className="text-xs text-muted-foreground tabular-nums">{ago}</span>
            </li>
          ))}
        </ul>
      </ScrollArea>
    </Panel>
  );
}

API reference

ScrollArea

component
PropTypeDefault
label *string—
children *ReactNode—
classNamestring—

Accessibility

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

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

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 Disclosure examples