Back to Components

Layout

ScrollArea

Overflow container with native-feel styled scrollbars. Pure-CSS — no JS deps.

Examples

Vertical with maxHeight

Row 1

Row 2

Row 3

Row 4

Row 5

Row 6

Row 7

Row 8

Row 9

Row 10

Row 11

Row 12

Row 13

Row 14

Row 15

Row 16

Row 17

Row 18

Row 19

Row 20

<ScrollArea maxHeight="180px">
  {#each rows as i}
    <p>Row {i}</p>
  {/each}
</ScrollArea>

Props

PropTypeDefaultDescription
maxHeightstringCap on the content height (any CSS length).
axis'vertical' | 'horizontal' | 'both''vertical'Which overflow axis to enable.
...restHTMLAttributes<HTMLDivElement>Spread onto the underlying <div>.

Install

CLI

npx @a3tai/mittsu add scroll-area