# Scroll area

A native horizontal, vertical, or two-axis scroll container with optional accessible region labelling and real edge actions.

Access: pro. Category: Essentials. Kind: composite.

## When to use

- Use it when a page needs a native horizontal, vertical, or two-axis scroll container with optional accessible region labelling and real edge actions.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.

## Alternatives

- Choose tidal-button instead when press, loading, success and disabled states is the actual interface need, rather than scroll area.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Scroll area

```sh
npx shadcn@latest add @tidal-pro/scroll-area
```

Stylesheets: `components/ui/tidal.css`, `components/ui/scroll-area.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/scroll-area.css";
import{TidalScrollArea}from"./components/ui/scroll-area";
export default()=><div className="tidal-scope"><TidalScrollArea children={"value"}/></div>;
```

## Structured props

- `TidalScrollArea.children: ReactNode`: Required children value accepted by this exported component.
- `TidalScrollArea.contentProps?: Omit<HTMLAttributes<HTMLDivElement>, "children"> | undefined`: Optional content props value accepted by this exported component.
- `TidalScrollArea.contentRef?: Ref<HTMLDivElement> | undefined`: Optional content ref value accepted by this exported component.
- `TidalScrollArea.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalScrollArea.endAction?: TidalScrollAction | undefined`: Optional end action value accepted by this exported component.
- `TidalScrollArea.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalScrollArea.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalScrollArea.meta?: ReactNode`: Optional meta value accepted by this exported component.
- `TidalScrollArea.orientation?: TidalScrollOrientation | undefined` (default "vertical"): Optional orientation value accepted by this exported component.
- `TidalScrollArea.regionLabel?: string | undefined`: Optional region label value accepted by this exported component.
- `TidalScrollArea.regionLabelledBy?: string | undefined`: Optional region labelled by value accepted by this exported component.
- `TidalScrollArea.startAction?: TidalScrollAction | undefined`: Optional start action value accepted by this exported component.
- `TidalScrollArea.title?: ReactNode`: Optional title value accepted by this exported component.
- `TidalScrollArea.viewportProps?: Omit<HTMLAttributes<HTMLDivElement>, "role" | "aria-label" | "aria-labelledby" | "children"> | undefined`: Optional viewport props value accepted by this exported component.
- `TidalScrollArea.viewportRef?: Ref<HTMLDivElement> | undefined`: Optional viewport ref value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/scroll-area.tsx) | [Manifest](https://tidalui.com/examples/scroll-area.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useRef, useState } from "react";

import { TidalScrollArea } from "./components/ui/scroll-area";

import "./components/ui/scroll-area.css";



const tidalExampleStyles = ".tidal-scope .scroll-area-demo,\n.tidal-scope .scroll-area-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .scroll-area-demo {\n  width: 100%;\n  min-width: 0;\n  container: scroll-area-demo / inline-size;\n}\n\n.tidal-scope .scroll-area-demo-frame {\n  min-width: 0;\n  padding: 22px;\n  border: 1px solid var(--t-border);\n  border-radius: 22px;\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px) 0 0 / 30px 30px,\n    var(--t-subtle);\n}\n\n.tidal-scope .scroll-area-demo-list {\n  display: grid;\n  width: max-content;\n  min-width: 100%;\n  grid-template-columns: repeat(6, minmax(226px, 1fr));\n  gap: 1px;\n  margin: 0;\n  padding: 0;\n  background: var(--t-border);\n  list-style: none;\n}\n\n.tidal-scope .scroll-area-demo-list > li {\n  display: flex;\n  min-width: 0;\n  min-height: 238px;\n  flex-direction: column;\n  padding: 18px;\n  background: var(--t-surface);\n  animation: tidal-scroll-card-in 420ms var(--t-ease-out) both;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(2) {\n  animation-delay: 48ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(3) {\n  animation-delay: 96ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(4) {\n  animation-delay: 144ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(5) {\n  animation-delay: 192ms;\n}\n\n.tidal-scope .scroll-area-demo-list > li:nth-child(n + 6) {\n  animation-delay: 240ms;\n}\n\n.tidal-scope .scroll-area-demo-index {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 700;\n  letter-spacing: 0.09em;\n  line-height: 1.35;\n  text-transform: uppercase;\n}\n\n.tidal-scope .scroll-area-demo-list time {\n  margin-top: auto;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.4;\n}\n\n.tidal-scope .scroll-area-demo-list h3 {\n  max-width: 13ch;\n  margin: 9px 0 0;\n  font-size: 21px;\n  font-weight: 570;\n  letter-spacing: -0.045em;\n  line-height: 1.05;\n  text-wrap: balance;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .scroll-area-demo-list p {\n  max-width: 34ch;\n  margin: 10px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n@container scroll-area-demo (max-width: 520px) {\n  .tidal-scope .scroll-area-demo-frame {\n    padding: 7px;\n  }\n\n  .tidal-scope .scroll-area-demo-list {\n    grid-template-columns: repeat(6, minmax(252px, 1fr));\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .scroll-area-demo-list > li {\n    animation: none;\n  }\n}\n\n@keyframes tidal-scroll-card-in {\n  from {\n    opacity: 0;\n    transform: translateY(7px);\n  }\n}";

const RELEASES = [
  {
    id: "r-13",
    version: "1.3",
    dateTime: "2026-09-29",
    date: "Sep 29",
    title: "Mobile details",
    summary: "Narrow previews keep readable controls and natural scrolling.",
  },
  {
    id: "r-14",
    version: "1.4",
    dateTime: "2026-10-02",
    date: "Oct 2",
    title: "Search recovery",
    summary: "Empty results include a direct reset with stable input focus.",
  },
  {
    id: "r-15",
    version: "1.5",
    dateTime: "2026-10-05",
    date: "Oct 5",
    title: "Activity groups",
    summary: "Grouped updates now keep time, actor, and context together.",
  },
  {
    id: "r-16",
    version: "1.6",
    dateTime: "2026-10-08",
    date: "Oct 8",
    title: "Project labels",
    summary: "Faster filtering with removable labels and visible counts.",
  },
  {
    id: "r-17",
    version: "1.7",
    dateTime: "2026-10-11",
    date: "Oct 11",
    title: "Invoice layouts",
    summary: "Compact totals and line-item details for document previews.",
  },
  {
    id: "r-18",
    version: "1.8",
    dateTime: "2026-10-14",
    date: "Oct 14",
    title: "Keyboard review",
    summary:
      "Clear focus order and visible recovery actions across the library.",
  },
] as const;

export function ScrollAreaDemo() {
  const viewportRef = useRef<HTMLDivElement>(null);
  const [position, setPosition] = useState("At the first update.");

  function updatePosition(node: HTMLDivElement) {
    const maximum = Math.max(0, node.scrollWidth - node.clientWidth);
    if (node.scrollLeft <= 4) setPosition("At the first update.");
    else if (node.scrollLeft >= maximum - 4)
      setPosition("At the latest update.");
    else setPosition("Reviewing the updates in between.");
  }

  return (
    <section className="scroll-area-demo" aria-label="Release notes preview">
      <div className="scroll-area-demo-frame">
        <TidalScrollArea
          title="Release notes"
          description="Browse the latest product updates."
          meta={`${RELEASES.length} updates`}
          orientation="horizontal"
          viewportRef={viewportRef}
          viewportProps={{
            onScroll: (event) => updatePosition(event.currentTarget),
          }}
          startAction={{
            label: "First update",
            accessibleLabel: "Scroll to the first release update",
            onAction: () => setPosition("Returning to the first update."),
          }}
          endAction={{
            label: "Latest update",
            accessibleLabel: "Scroll to the latest release update",
            onAction: () => setPosition("Moving to the latest update."),
          }}
          footer={
            <span role="status" aria-live="polite">
              {position} Sample data. Changes stay in this preview.
            </span>
          }
        >
          <ol className="scroll-area-demo-list">
            {RELEASES.map((release, index) => (
              <li key={release.id}>
                <div className="scroll-area-demo-index">
                  <span>{String(index + 1).padStart(2, "0")}</span>
                  <span>v{release.version}</span>
                </div>
                <time dateTime={release.dateTime}>{release.date}</time>
                <h3>{release.title}</h3>
                <p>{release.summary}</p>
              </li>
            ))}
          </ol>
        </TidalScrollArea>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <ScrollAreaDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

children are required consumer-owned content. orientation selects native horizontal, vertical or two-axis overflow. Optional title/description/meta render a compact header; a title, regionLabel or external regionLabelledBy gives the viewport a named region role. The viewport becomes keyboard-focusable only while measured overflow exists unless the consumer supplies an explicit tabIndex. Optional startAction and endAction are native buttons that scroll the real viewport to logical content edges, including RTL. Supplied native button handlers run first and prevention suppresses scrolling and onAction. Actions preserve explicit type/form/attributes/refs while label, controls and native disabled semantics remain component-owned. Root, viewport and content attributes/refs pass through with React 19 callback-ref cleanup; viewport scroll handlers remain native. Optional heading level and footer remain consumer-owned. Reduced motion makes programmatic edge scrolling immediate. The component performs no data mutation, request, routing, analytics, network, storage or persistence action.
