# ScrollArea (@limerdev/zest) 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. - Category: Layout - Import: `import { ScrollArea } from '@limerdev/zest'` - Bits UI: `ScrollArea`, https://bits-ui.com/docs/components/scroll-area - Exports: `ScrollArea.Root`, `ScrollArea.Scrollbar` - 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. ```svelte {#each projects as project (project.id)}

{project.name}

{/each}
``` Props of `ScrollArea.Root`: - `dir` (`"ltr" | "rtl"`): The reading direction of the application. - `orientation` (`"both" | "horizontal" | "vertical"`, default `'vertical'`): Which scrollbars to draw: `vertical`, `horizontal` or `both`. - `scrollbarXClasses` (`string`, default `''`): Classes for the horizontal scrollbar. - `scrollbarYClasses` (`string`, default `''`): Classes for the vertical scrollbar. - `scrollHideDelay` (`number`, default `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"`, default `"hover"`): The type of scroll area to render. - `viewportRef` (`HTMLElement | null`, default `null`, bindable): The scrolling viewport element. Bindable. Props of `ScrollArea.Scrollbar`: - `forceMount` (`boolean`): Whether to forcefully mount the component. Useful when working with external animation/transition libraries. - `orientation` (`"horizontal" | "vertical"`, default `'vertical'`, required) Example: A list A fixed-height list with a slim scrollbar. ```svelte

Projects

{#each projects as project, index (project)} {#if index > 0} {/if}

{project}

{/each}
``` Example: Horizontal orientation="horizontal" scrolls a row sideways. ```svelte
{#each weeks as week (week)}
Week {week}
{/each}
```