Scroll Area

Base UI

A constrained viewport with a consistent, unobtrusive scrollbar.

ReadyResponsive

Usage

Package export
tsx
import { ScrollArea } from "@jnpll/elements-ui/scroll-area";

<ScrollArea className="h-56 w-full max-w-sm rounded-lg border">
  <div className="p-4">
    <h3 className="mb-4 font-medium">{"Activity"}</h3>
    {Array.from({ length: 18 }, (_, i) => (
      <div key={i} className="border-b py-3 text-sm">Workspace update {i + 1}</div>
    ))}
  </div>
</ScrollArea>

Examples

Scrollable content

API Reference

PropType / descriptionDefault
childrenReactNode

Scrollable content.

-
classNamestring

Defines viewport dimensions and surface styles.

-
ScrollBar.orientation"vertical" | "horizontal"

Scrollbar direction; the default ScrollArea includes a vertical bar.

"vertical"

Composition & accessibility

Give ScrollArea an explicit height to enable vertical scrolling. The exported ScrollBar supports horizontal orientation for custom compositions.