- Home
- Primitives
- Scroll Area
Scroll Area
Custom-styled scrollbar with native scrolling performance.
Preview
This preview uses documentation-only styling. Ship with one of the included recipe outputs (CSS, Tailwind, or UnoCSS) for production styles.
Custom-styled scrollbar with native scrolling performance.
Usage
Compose Root, Viewport, Scrollbar, Thumb.
import * as ScrollArea from "@solidiom/scroll-area"
;<ScrollArea.Root>Scroll Area content</ScrollArea.Root>Installation
Install the package with pnpm add @solidiom/scroll-area. The package requires compatible solid-js and @solidjs/web peer dependencies.
Parts
Scroll Area exposes 4 parts:
- Root —
data-part="root". - Viewport —
data-part="viewport". - Scrollbar —
data-part="scrollbar". - Thumb —
data-part="thumb".
Styling
Scroll Area carries data-scope="scroll-area" and data-part attributes on each part for CSS/recipe targeting. State attributes like data-state, data-disabled, and data-highlighted are exposed where applicable.
Keyboard & behavior
This primitive has no keyboard interaction. It renders content that does not independently receive focus or respond to key events.
Composition
Scroll Area is designed to compose with other primitives. Its parts can be combined with Field, Button, or other primitives as needed.
SSR and hydration
Scroll Area renders as semantic HTML during server rendering. Interactive behavior (keyboard handlers, state management) activates on hydration without layout shift.