apps/v4/content/docs/components/base/scroll-area.mdx
<ComponentPreview styleName="base-nova" name="scroll-area-demo" previewClassName="h-96" />
npx shadcn@latest add scroll-area
<Step>Install the following dependencies:</Step>
npm install @base-ui/react
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="scroll-area" title="components/ui/scroll-area.tsx" styleName="base-nova" />
<Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"
<ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
Your scrollable content here.
</ScrollArea>
Use ScrollBar with orientation="horizontal" for horizontal scrolling.
To enable RTL support in shadcn/ui, see the RTL configuration guide.
<ComponentPreview styleName="base-nova" name="scroll-area-rtl" direction="rtl" previewClassName="h-auto" />
See the Base UI Scroll Area documentation.