ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β π shadcn/directory/cosscom/coss/components/scroll-area β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
title: Scroll Area description: A native scroll container with custom scrollbars.
<ComponentPreview name="scroll-area-demo" className="[&_.preview>*]:w-full [&_.preview>*]:max-w-64" />
npx shadcn@latest add @coss/scroll-area
</TabsPanel>
<TabsPanel value="manual">
<Steps>
<Step>Install the following dependencies:</Step>
npm install @base-ui-components/react
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="scroll-area" title="components/ui/scroll-area.tsx" /><Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsPanel> </CodeTabs>import { ScrollArea } from "@/components/ui/scroll-area"
<ScrollArea className="h-64 rounded-md border">
<div className="p-4">
Just as suddenly as it had begun, the sensation stopped, leaving Alice
feeling slightly disoriented. She looked around and realized that the room
hadn't changed at all - it was she who had grown smaller, shrinking down to
a fraction of her previous size. Alice felt herself growing larger and
larger, filling up the entire room until she feared she might burst. The
sensation was both thrilling and terrifying, as if she were expanding beyond
the confines of her own body. She wondered if this was what it felt like to
be a balloon, swelling with air until it could hold no more.
</div>
</ScrollArea>
If youβre already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with coss ui quickly.
asChild on parts, switch to the render propCompared to shadcn/ui, our ScrollArea adds orientation="both", which renders both vertical and horizontal scrollbars (and the corner). Use it when content can overflow on both axes.
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ