nook
Browse the docs

Components

Scroll area

Native

A labelled native scroll container with keyboard focus and themed scrollbars.

See the prompt

What shipped this week

  1. November 15, 2026

    Faster search across archived projects

  2. November 14, 2026

    Export reports as a spreadsheet

  3. November 13, 2026

    Invite reviewers without a paid seat

  4. November 12, 2026

    Set a default timezone for your team

  5. November 11, 2026

    Restore recently deleted files

  6. November 10, 2026

    Pin the views you use every morning

  7. November 9, 2026

    New keyboard shortcuts for the inbox

  8. November 8, 2026

    More control over email digests

Installation

npx nook-ui@latest add scroll-area

Prompt

Paste this into your AI coding assistant. It adds this exact component, the same way the CLI does, and tells the assistant how to use it.

Short. For assistants that can run commands in your project.

Plain text
Add the Nook "Scroll area" component to this project, exactly as Nook ships it.

A labelled native scroll container with keyboard focus and themed scrollbars.

Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add scroll-area`. It writes `components/ui/scroll-area.tsx` together with everything the component needs. Do not write the component from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/scroll-area.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Use it where I ask. Start from this example:

```tsx
import { ScrollArea } from "@/components/ui/scroll-area";
const releases = [
  "Faster search across archived projects",
  "Export reports as a spreadsheet",
  "Invite reviewers without a paid seat",
  "Set a default timezone for your team",
  "Restore recently deleted files",
  "Pin the views you use every morning",
  "New keyboard shortcuts for the inbox",
  "More control over email digests",
];
export default function Example() {
  return (
    <div className="w-full max-w-md">
      <h3 className="mb-3 font-semibold">What shipped this week</h3>
      <ScrollArea
        aria-label="Release notes"
        className="h-52 border-(length:--edge) border-(--surface-edge) bg-card p-inset"
      >
        <ol className="divide-y divide-border">
          {releases.map((release, i) => (
            <li key={release} className="py-3 first:pt-0">
              <span className="text-xs text-muted-foreground">
                November {15 - i}, 2026
              </span>
              <p className="mt-1 text-sm font-medium">{release}</p>
            </li>
          ))}
        </ol>
      </ScrollArea>
    </div>
  );
}
```

API
- `ScrollArea`: A labelled native scroll container with keyboard focus and themed scrollbars.
  - `aria-label` (`string`): Required name for the scrolling region.
  - `orientation` (`"vertical" | "horizontal" | "both"`, default "both"): Which way it scrolls. Horizontal also turns the mouse wheel into sideways scrolling and keeps the page scrolling once the row reaches either end.
  - `children` (`ReactNode`): Content to scroll.

Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- Accessibility: A named region receives focus so arrow and page keys can scroll it.

Done when the component renders like the example in light and dark mode and the project type-checks.

Usage

import { ScrollArea } from "@/components/ui/scroll-area";
const releases = [
  "Faster search across archived projects",
  "Export reports as a spreadsheet",
  "Invite reviewers without a paid seat",
  "Set a default timezone for your team",
  "Restore recently deleted files",
  "Pin the views you use every morning",
  "New keyboard shortcuts for the inbox",
  "More control over email digests",
];
export default function Example() {
  return (
    <div className="w-full max-w-md">
      <h3 className="mb-3 font-semibold">What shipped this week</h3>
      <ScrollArea
        aria-label="Release notes"
        className="h-52 border-(length:--edge) border-(--surface-edge) bg-card p-inset"
      >
        <ol className="divide-y divide-border">
          {releases.map((release, i) => (
            <li key={release} className="py-3 first:pt-0">
              <span className="text-xs text-muted-foreground">
                November {15 - i}, 2026
              </span>
              <p className="mt-1 text-sm font-medium">{release}</p>
            </li>
          ))}
        </ol>
      </ScrollArea>
    </div>
  );
}

Examples

Horizontal

  • Night Train
  • Salt Flats
  • The Quiet Year
  • Paper Boats
  • Low Tide
  • Ash and Ivy

Chat log

  • Ana Did the build finish?
  • Kofi Yes, green on all three.
  • Ana Great, shipping now.
  • Priya Can someone update the changelog?
  • Kofi On it.
  • Ana Thanks both.
  • Priya Release notes are live.

Both axes

A1A2A3A4A5A6A7A8A9A10B1B2B3B4B5B6B7B8B9B10C1C2C3C4C5C6C7C8C9C10D1D2D3D4D5D6D7D8D9D10E1E2E3E4E5E6E7E8E9E10F1F2F3F4F5F6F7F8F9F10G1G2G3G4G5G6G7G8G9G10H1H2H3H4H5H6H7H8H9H10

A wide table

InvoiceCustomerIssuedDueAmountStatus
INV-1042Northwind CoffeeNov 3Nov 17$1,240.00Paid
INV-1043Harbor WorksNov 5Nov 19$860.50Due in 3 days
INV-1044Lumen HealthNov 9Nov 23$2,015.00Sent
INV-1045Orchard BankNov 12Nov 26$430.00Draft

Props

ScrollArea

A labelled native scroll container with keyboard focus and themed scrollbars.

PropTypeDefaultDescription
aria-labelstring–Required name for the scrolling region.
orientation"vertical" | "horizontal" | "both""both"Which way it scrolls. Horizontal also turns the mouse wheel into sideways scrolling and keeps the page scrolling once the row reaches either end.
childrenReactNode–Content to scroll.

Accessibility

A named region receives focus so arrow and page keys can scroll it.

Checked against WCAG 2.1 AA with automated axe tests and keyboard tests on every release.