Component reference
ScrollArea
A bounded, scrollable activity list.
Preview
Live previewOptional six-digit hex. Clear to restore the preset. Check contrast with your brand color.
Changes apply to this preview only.
Releases
Fourteen rows in a 260px viewport.
Width adapts to the available space
"use client";
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
ScrollArea
} from "@pimolu/react";
const items = Array.from(
{ length: 14 },
(_, index) => ({
title: `Release ${14 - index}`,
meta: `2026-10-${String(19 - index).padStart(2, "0")}`,
})
);
export function DemoExample() {
return (
<Card>
<CardHeader>
<CardTitle>Releases</CardTitle>
<CardDescription>Fourteen rows in a 260px viewport.</CardDescription>
</CardHeader>
<CardContent>
<ScrollArea maxHeight={260}>
<div className="grid gap-5 min-w-0">
{
items.map((item) => (<div
key={item.title}
className="flex flex-wrap items-center gap-3 min-w-0 justify-between"
>
<span>{item.title}</span>
<span className="text-sm text-muted leading-relaxed">{item.meta}</span>
</div>))
}
</div>
</ScrollArea>
</CardContent>
</Card>
);
}More examples
Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.
Keyboard-scrollable activity log
Focus the viewport and scroll a labelled sequence without moving the page.
Horizontal
The viewport scrolls sideways; the content keeps its natural width.
Both
A wide table can scroll in both directions inside a bounded height.
Usage
Constrain the region deliberately rather than clipping content or the entire page.
API reference
Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.
PimoluScrollAreaProps
Type source| Name | Type | Default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | "both" | undefined | "vertical" | Scroll direction. Defaults to "vertical". |
maxHeight | string | number | undefined | — | Maximum height of the scroll viewport. |
viewportClassName | string | undefined | — | Class applied to the scrollable viewport. |
childrenRequired | ReactNode | — | Public Pimolu prop; see the source declaration for details. |
defaultValue | string | number | readonly string[] | undefined | — | Standard React/HTML attribute. |
className | string | undefined | — | Standard React/HTML attribute. |
style | CSSProperties | undefined | — | Standard React/HTML attribute. |
aria-label | string | undefined | — | Defines a string value that labels the current element. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | undefined | — | Standard React/HTML attribute. |
onClick | MouseEventHandler<HTMLDivElement> | undefined | — | Standard React/HTML attribute. |
orientation"horizontal" | "vertical" | "both" | undefinedDefault: "vertical"
Scroll direction. Defaults to "vertical".
maxHeightstring | number | undefinedNo default extracted.
Maximum height of the scroll viewport.
viewportClassNamestring | undefinedNo default extracted.
Class applied to the scrollable viewport.
childrenRequiredReactNodeNo default extracted.
Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefinedNo default extracted.
Standard React/HTML attribute.
classNamestring | undefinedNo default extracted.
Standard React/HTML attribute.
styleCSSProperties | undefinedNo default extracted.
Standard React/HTML attribute.
aria-labelstring | undefinedNo default extracted.
Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefinedNo default extracted.
Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefinedNo default extracted.
Standard React/HTML attribute.
Accessibility
- Make the region discoverable and ensure keyboard users can reach all its content.