Scroll Area

Augments native scroll functionality for custom, cross-browser styling.

import * as React from "react"

import { ScrollArea } from "@/components/ui/scroll-area"
import { Separator } from "@/components/ui/separator"

Installation

pnpm slabui add scroll-area

Usage

import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"
<ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
  Your scrollable content here.
</ScrollArea>

Composition

Use the following composition to build a ScrollArea:

ScrollArea
โ””โ”€โ”€ ScrollBar

Horizontal

Use ScrollBar with orientation="horizontal" for horizontal scrolling.

import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"

export interface Artwork {
  artist: string
  art: string

API Reference

See the Base UI Scroll Area documentation.