ScrollArea

Layout

A scrollable box with slim scrollbars that match the theme: give it a height (or width) and orientation (vertical, horizontal, both). It scrolls with the wheel, touch and keyboard like any scrolling box. ScrollArea.Scrollbar is there for custom layouts.

import { ScrollArea } from '@limerdev/zest';
ScrollArea for AI tools (llms.txt)
Use for
A long list inside a fixed panel: a sidebar's projects, a dialog's terms, a wide table in a card.
Don't
The page's own scrolling: let the window scroll. Content that fits: no scroll box.

Examples

A list

A fixed-height list with a slim scrollbar.

Projects

Project 1

Project 2

Project 3

Project 4

Project 5

Project 6

Project 7

Project 8

Project 9

Project 10

Project 11

Project 12

Project 13

Project 14

Project 15

Project 16

Project 17

Project 18

Project 19

Project 20

Project 21

Project 22

Project 23

Project 24

Project 25

Project 26

Project 27

Project 28

Project 29

Project 30

Horizontal

orientation="horizontal" scrolls a row sideways.

Week 40
Week 41
Week 42
Week 43
Week 44
Week 45
Week 46
Week 47
Week 48
Week 49
Week 50
Week 51
Week 52
Week 53
Week 54
Week 55

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

ScrollArea.Root

Prop Type Default Description
dir "ltr" | "rtl" – The reading direction of the application.
orientation "both" | "horizontal" | "vertical" 'vertical' Which scrollbars to draw: vertical, horizontal or both.
scrollbarXClasses string '' Classes for the horizontal scrollbar.
scrollbarYClasses string '' Classes for the vertical scrollbar.
scrollHideDelay number 600 The amount of time in milliseconds to delay before hiding the scrollbars after leaving the scroll area or stopping scrolling.
type "auto" | "always" | "hover" | "scroll" "hover" The type of scroll area to render.
viewportRef bindable HTMLElement | null null The scrolling viewport element. Bindable.

ScrollArea.Scrollbar

Prop Type Default Description
forceMount boolean – Whether to forcefully mount the component. Useful when working with external animation/transition libraries.
orientation required "horizontal" | "vertical" 'vertical'