Scroll Area
A scroll container with propel's overlay scrollbar that reveals on hover or scroll, built on Base UI ScrollArea.
Show codeHide code
Installation
import { ScrollArea } from "@makeplane/propel/components/scroll-area";Usage
import { ScrollArea } from "@makeplane/propel/components/scroll-area";
const ACTIVITY = Array.from(
{ length: 24 },
(_, i) => `Astra updated the project roadmap — item ${i + 1}`,
);
export default function BasicDemo() {
// ScrollArea fills its parent, so it needs a height-constrained flex column to
// bound and scroll within. Inline styles keep the demo self-contained.
return (
<div style={{ display: "flex", flexDirection: "column", height: "16rem", width: "18rem" }}>
<ScrollArea orientation="vertical">
<div
style={{ display: "flex", flexDirection: "column", gap: "0.5rem", padding: "0.75rem" }}
>
{ACTIVITY.map((line) => (
<p key={line}>{line}</p>
))}
</div>
</ScrollArea>
</div>
);
}Children render inside the viewport. Base UI’s optional ScrollArea.Content wrapper is not part of the ready-made — add it yourself only if you need that slot.
Examples
Horizontal
Show codeHide code
Both axes
Show codeHide code
Always visible
Show codeHide code
Sizes
The size prop sets the scrollbar gutter (same pad as native scrollbar-*): sm (12 px / 4 → 4 px thumb), md (14 / 4 → 6), lg (16 / 4 → 8).
sm
md
lg
Show codeHide code
Native scrollbars
Propel also ships opt-in utilities that re-skin the browser’s own scrollbar: scrollbar-sm, scrollbar-md, and scrollbar-lg (from @makeplane/propel/styles). Put the class on any overflow element — no ScrollArea required.
| Utility | Track | Inset | Visible thumb |
|---|---|---|---|
scrollbar-sm |
12px | 4px | 4px |
scrollbar-md |
14px | 4px | 6px |
scrollbar-lg |
16px | 4px | 8px |
Same size ladder as ScrollArea’s size prop. Thumb colors use --scrollbar-thumb* (hidden at rest, stronger on container hover / thumb hover / drag).
Use native utilities when you want light styling on a normal overflow: auto region (text areas, dense panels) and can accept browser limits (Firefox: thinner control; no custom inset / per-thumb states).
Use ScrollArea when you need a consistent overlay thumb across browsers (including Firefox), controlled show/hide (visibility), or both-axis rails + corner.
<div className="scrollbar-sm max-h-96 overflow-y-auto">{/* … */}</div>API Reference
ScrollArea
A scroll container with propel's overlay scrollbar, built on Base UI `ScrollArea`. Use it to wrap any overflowing content (menus, panels, long lists). Place it as a child of a height-constrained flex column: it grows to fill the column and its viewport scrolls when the content overflows.