Scroll Area
Wraps content in a scroll viewport with a theme-colored scrollbar. Set orientation to vertical (the default), horizontal, or both.
Installation
Copy the command below and run it in your terminal.
Usage
Give ScrollArea a height or max height. class styles the outer frame. Other attributes, such as aria-label, go on the scrolling viewport,
which you can bind with bind:element.
In vertical orientation, a fade with a chevron appears at each edge that has more
content to scroll. Pass showCues={false} to hide the cues, or blur to blur the
content that scrolls under them.
Examples
Horizontal
Anatomy
ScrollArea - Provides a scrollable content area.
<script lang="ts"> import { ScrollArea } from '@sivir-ui/svelte/components/scroll-area'; const items = Array.from({ length: 10 }, (_, i) => { return `Item ${i + 1}`; }); </script> <ScrollArea class="h-48 w-48 rounded-[var(--radius-md)] border border-border p-3"> <div class="space-y-2"> {#each items as item (item)} <div class="text-sm">{item}</div> {/each} </div> </ScrollArea>