Scroll Area

A container with custom scrollbars for overflow content.

Installation

Install the component package, shared coss-svelte theme, and Bits UI peer.

npm install coss-svelte @coss-svelte/theme bits-ui

Usage

Import the Svelte component exports directly from the package.

import { ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "coss-svelte";

Anatomy

  • ScrollArea
  • ScrollAreaCorner
  • ScrollAreaScrollbar
  • ScrollAreaThumb
  • ScrollAreaViewport

API Reference

ScrollArea

A container with custom scrollbars for overflow content.

children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI ScrollArea.Root.

ScrollAreaCorner

Renders the corner where horizontal and vertical scrollbars meet.

children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI ScrollArea.Corner.

ScrollAreaScrollbar

Renders a scrollbar for the scroll area.

PropTypeDefaultDescription
orientationOrientation"vertical"Layout direction for the component.
children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI ScrollArea.Scrollbar.

ScrollAreaThumb

Renders the draggable or moving indicator.

children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI ScrollArea.Thumb.

ScrollAreaViewport

Wraps the scrollable viewport for the parent component.

children : Snippet<[]>bind:ref : HTMLElement | null

Inherits from Bits UI ScrollArea.Viewport.

Implementation Details

Status
Stable
Foundation
bits
Category
Layout & Navigation
Particles
5