Scroll Area

A native scroll container with a thin scrollbar.

Overview

ScrollArea uses the browser's own scrolling. Set a height or width with className. The scrollbar is the platform scrollbar, styled where the browser allows it. Keyboard, wheel, and touch scrolling stay native.

Preview

a1b2c3dfeat: add user cursor component
e4f5a6bfix: resolve race condition in auth flow
c7d8e9frefactor: extract control-schema helpers
a0b1c2dchore: update pnpm lockfile
e3f4a5bdocs: add score ring usage examples
c6d7e8ffeat: resizable table columns
a9b0c1dfix: accordion collapsible not remounting
e2f3a4bstyle: tighten preview container spacing
c5d6e7ftest: add registry-item snapshot tests
a8b9c0dfeat: live preview for all components

Customize

Orientation

Installation

Add the component with the CLI. It copies the files in and installs anything they depend on.

npx vinyaas add scroll-area

Usage

import { ScrollArea } from "@/components/ui/scroll-area"; export function Notes() { return ( <ScrollArea className="h-72" aria-label="Notes"> <p>A long note.</p> </ScrollArea> ); }

Examples

Vertical

A fixed height makes the vertical scroll container obvious. Long content scrolls inside the box.

ScrollArea uses the browser's own scrolling. Set a height with className.

Keyboard, wheel, and touch scrolling stay native. The scrollbar is the platform scrollbar, styled where the browser allows it.

Pair it with a label so assistive technology can name the region.

Keep the surrounding page from growing when content is long.

Nested lists and long copy stay inside the frame while the rest of the layout stays put.

  • Registry publish for Button and Dialog
  • Accessibility pass on focus rings
  • Docs refresh for ScrollArea and Toast
  • Smoke tests for horizontal overflow
  • Changelog entry for v2.4.1

Shortcuts

The row is wider than the bordered container, so it scrolls sideways. The page width does not grow with it.

  • ⌘KOpen command menu
  • ⌘PQuick open
  • ⌘⇧PCommand palette
  • ⌘BToggle sidebar
  • ⌘.Open settings

Both axes

orientation="both" scrolls a wide grid that is also taller than the frame.

Web

Monday

Docs

Monday

CLI

Monday

Registry

Monday

Preview

Monday

Release

Monday

Web

Tuesday

Docs

Tuesday

CLI

Tuesday

Registry

Tuesday

Preview

Tuesday

Release

Tuesday

Web

Wednesday

Docs

Wednesday

CLI

Wednesday

Registry

Wednesday

Preview

Wednesday

Release

Wednesday

Web

Thursday

Docs

Thursday

CLI

Thursday

Registry

Thursday

Preview

Thursday

Release

Thursday

In practice

A notifications panel keeps a fixed-height ScrollArea for the feed while the header and actions stay put.

Notifications

Updates from the last day.


  • SK

    Sarah created a new project

    Production Dashboard

    2m

  • AL

    Alex deployed an update

    v2.4.1

    8m

  • SK

    Sarah invited a reviewer

    Design notes

    21m

  • AL

    Alex closed an issue

    Keyboard focus

    1h

  • SK

    Sarah published a release

    v1.0.0

    3h

  • PS

    Priya commented on a review

    Button states

    5h

API

Other attributes for the underlying element are passed through.

NameTypeDefaultDescription
orientation"vertical" | "horizontal" | "both""vertical"Chooses which axes use native overflow.
classNamestring—Merged onto the scroll container with cn. Set the height or width here.

Accessibility

The container is a normal div. It is focusable so keyboard users can scroll it. It does not add a role. ScrollBar is hidden from assistive technology because the native container already scrolls.