Scroll Area

Used to display long or wide content in a scrollable, animated area.

Install

pnpm dlx shadcn@latest add https://www.katestroyui.com/r/scroll-area

Usage

1import { ScrollArea, ScrollAreaItem } from "@/components/ui/scroll-area";
2import React from "react";
3
4export function Example() {
5 return (
6 <ScrollArea className="h-72 w-64 rounded-lg border p-4">
7 <ul className="space-y-4">
8 {Array.from({ length: 20 }).map((_, i) => (
9 <ScrollAreaItem
10 key={i}
11 className="h-10 w-full rounded-md bg-blue-100 flex items-center justify-center"
12 />
13 ))}
14 </ul>
15 </ScrollArea>
16 );
17}

Props

PropTipAçıklamaVarsayılan
orientation"vertical" | "horizontal"Kaydırma yönü"vertical"
childrenReact.ReactNodeScrollAreaItem veya içerik-
classNamestringEkstra CSS sınıfları-
styleReact.CSSPropertiesInline stil-