---
title: "Scroll Area"
description: "Deprecated scrollable container with custom scrollbars"
deprecated: true
source: "Equality"
---
> **Deprecated** — Deprecated in favour of browser-native scroll areas. Set an overflow and a height on your own element instead.

import { ScrollArea } from "@eqtylab/equality";

## Overview

Scroll Area wrapped content in [Radix UI Scroll Area](https://www.radix-ui.com/primitives/docs/components/scroll-area) so that overflowing content got a styled, cross-browser scrollbar instead of the native one.

This component is deprecated. Browsers now render restrained, theme-aware scrollbars of their own. New code should use a native scrollable element. Existing usage will be removed in a future release.

## Migrating

Replace the component with an element that scrolls natively. Give it a height and an overflow, and leave the scrollbar alone — the browser draws one that already matches the user's platform and colour scheme:

```tsx
// Before
<ScrollArea className="h-48 max-w-lg">
  <div>{/* long content */}</div>
</ScrollArea>

// After
<div className="h-48 max-w-lg overflow-y-auto">
  <div>{/* long content */}</div>
</div>
```

Use `overflow-x-auto` for horizontal scrolling, in place of `<ScrollBar orientation="horizontal" />`.

Do not restyle the scrollbar. The `styled-vertical-scrollbar` and `styled-horizontal-scrollbar` utilities have been removed, and `::-webkit-scrollbar` rules of your own are a WebKit-only fork of a control the browser already themes. Dialog and Sheet now scroll this way too.

## Usage

Import the component:

```tsx
import { ScrollArea } from "@eqtylab/equality";
```

Set a height on the Scroll Area and place your content inside:

```tsx
<ScrollArea className="h-48 max-w-lg">
  <div>{/* long content */}</div>
</ScrollArea>
```

## Example

<ScrollArea client:only="react" className="h-48 max-w-lg">
  <div className="text-text-secondary space-y-4 pr-4 text-base/7">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

    Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

    Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur.

    Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur. At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.

    Similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.

  </div>
</ScrollArea>

## Slots

| Name         | Description                                                                           |
| ------------ | ------------------------------------------------------------------------------------- |
| `ScrollArea` | The scrollable container. Wraps your content and renders a styled vertical scrollbar. |
| `ScrollBar`  | The scrollbar element, exported for advanced composition (e.g. a horizontal bar).     |

## Props

Scroll Area forwards the underlying [Radix Scroll Area Root](https://www.radix-ui.com/primitives/docs/components/scroll-area#root) props (such as `type` and `scrollHideDelay`) in addition to the props below.

| Name        | Description                                           | Type        | Default | Required |
| ----------- | ----------------------------------------------------- | ----------- | ------- | -------- |
| `children`  | The content to render inside the scrollable viewport. | `ReactNode` | —       | ✅       |
| `className` | Additional CSS classes applied to the container.      | `string`    | —       | ❌       |