Scroll Area

A container with a custom-styled scrollbar, replacing the browser default.

Install

npx @vultra/cli add scroll-area

Usage

<script>
  import { ScrollArea } from '@vultra/ui';
</script>

<ScrollArea class="h-64">
  <div class="space-y-4 p-4">
    {#each Array(50) as _, i}
      <p>Scroll item {i + 1}</p>
    {/each}
  </div>
</ScrollArea>

Props

PropTypeDefaultDescription
orientation‘vertical’ | ‘horizontal’ | ‘both’‘vertical’Scroll direction
scrollbarWidthnumber8Scrollbar width in pixels
classstring-Additional CSS classes

Slots

SlotDescription
defaultScrollable content

Notes

  • Scrollbar appears on hover or during scroll.
  • Hides automatically when content doesn’t overflow.
  • Works consistently across browsers (custom scrollbar).