Display
ScrollArea
Scrollable container with overlay scrollbars styled by the theme, backed by Bits UI.
<script>
import { ScrollArea } from "@codeatlasdev/ui";
</script>
<ScrollArea maxHeight="240px">…</ScrollArea>
The area scrolls once its content exceeds maxHeight or maxWidth, so set one of them (or a height through class). Native scrolling, touch momentum and keyboard scrolling are preserved.
Vertical scroll
Capped with `maxHeight`.
Code
Horizontal scroll
`orientation="horizontal"` with always-visible scrollbars.
Code
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | 'hover' | 'scroll' | 'auto' | 'always' | 'hover' | When the scrollbar is visible. |
orientation | 'vertical' | 'horizontal' | 'both' | 'vertical' | Which scrollbars to render. |
maxHeight | string | undefined | CSS max-height of the area, for example `'240px'`. |
maxWidth | string | undefined | CSS max-width of the area. |
class | string | '' | Extra class names. |
children | Snippet | undefined | Scrollable content. |