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";34export 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 <ScrollAreaItem10 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
Prop | Tip | Açıklama | Varsayılan |
---|---|---|---|
orientation | "vertical" | "horizontal" | Kaydırma yönü | "vertical" |
children | React.ReactNode | ScrollAreaItem veya içerik | - |
className | string | Ekstra CSS sınıfları | - |
style | React.CSSProperties | Inline stil | - |