For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
119

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";

const tags = Array.from({ length: 50 }).map(

Installation

$ pnpm dlx shadcn@latest add https://shadcn-cssinjs.com/r/scroll-area.json

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 Image from "next/image";
import * as React from "react";

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

export interface Artwork {

RTL

To enable RTL support in shadcn/ui, see the RTL configuration guide.

"use client";

import * as React from "react";

import { useTranslation } from "@/components/language-selector";
import type { Translations } from "@/components/language-selector";

API Reference

See the Base UI Scroll Area documentation.