# ScrollArea
ScrollArea is a cross browser, lightweight and themable alternative to native browser scrollbar.
## Installation
Shadcn CLI
Manual
```bash
npx shadcn@latest add https://primereact.dev/r/scrollarea.json
```
Copy and paste the following code into your project
Update the import paths to match your project setup.
## Usage
```tsx
import { ScrollArea, ScrollAreaContent, ScrollAreaScrollbar, ScrollAreaHandle, ScrollAreaViewport } from '@/components/ui/scrollarea';
```
```tsx
```
## Examples
### Basic
A custom scrollable container with styled scrollbars.
### Horizontal
ScrollArea supports horizontal scrolling for content that extends beyond the horizontal viewport.
### Both Scrollbars
### Scroll Fade
### Variant
Change the visibility behavior of scrollbars with the `variant` property.
### Custom
## Related
### Sub-Components
See [Primitive API](/docs/primitive/components/scrollarea#api) for `ScrollAreaRoot`, `ScrollAreaViewport`, `ScrollAreaContent`, `ScrollAreaScrollbar`, and `ScrollAreaHandle` component documentation.
### Hooks
See [Headless API](/docs/headless/components/scrollarea#api) for `useScrollArea` hook documentation.
### Accessibility
See [ScrollArea Primitive](/docs/primitive/components/scrollarea#accessibility) for WAI-ARIA compliance details and keyboard support.