0

Scroll Area

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

import * as React from "react"

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

Installation

bunx --bun shadcn@latest add @ondo-ui/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

Examples

Horizontal

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

import * as React from "react"
import Image from "next/image"

API reference

The component wraps Base UI ScrollArea and accepts all of its props.