# 滚动区域 · JGuang UI

> 提供跨浏览器一致的自定义滚动容器。

- 页面: https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/scroll-area
- 改编自: shadcn/ui 文档 (MIT) @ bc0705384b51252af26dcc65425b216bf5eb063c
- 说明：正文保留英文原文。

> 示例 `scroll-area-demo`: 交互预览见 https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/scroll-area


## Installation


  

**Command**


  

**Manual**


```text
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
```


### Install the following dependencies:


```bash
npm install radix-ui
```


### Copy and paste the following code into your project.


[View complete source: components/ui/scroll-area.tsx](/r/jguang-ui/radix/scroll-area.json)


### Update the import paths to match your project setup.


## Usage

```tsx showLineNumbers
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"
```

```tsx showLineNumbers
<ScrollArea className="h-[200px] w-[350px] rounded-md border p-4">
  Your scrollable content here.
</ScrollArea>
```

## Composition

Use the following composition to build a `ScrollArea`:

```text
ScrollArea
└── ScrollBar
```

## Horizontal

Use `ScrollBar` with `orientation="horizontal"` for horizontal scrolling.


> 示例 `scroll-area-horizontal-demo`: 交互预览见 https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/scroll-area


## RTL

To enable RTL support in JGuang UI, see the [RTL configuration guide](/systems/jguang-ui/docs/rtl).


> 示例 `scroll-area-rtl`: 交互预览见 https://jiguang132.com/zh/systems/jguang-ui/docs/components/radix/scroll-area


## API Reference

See the [Radix UI Scroll Area](https://www.radix-ui.com/docs/primitives/components/scroll-area#api-reference) documentation.

---

JGuang 全部资源索引: https://jiguang132.com/llms.txt
