# Scroll Area

- **Section:** Components
- **URL:** https://refast.fastapicloud.dev/docs/components/scroll-area
- **Markdown:** https://refast.fastapicloud.dev/docs/components/scroll-area.md
- **Source:** https://github.com/idling-mind/refast-docs/blob/main/docs/pages/components/layout/scroll_area.py
- **Live examples:** the widgets on this page need a browser; open the URL above to try them.
- **Applies to:** refast 0.12.2

A scrollable container with custom, styled scrollbars (Radix UI `ScrollArea`).

```python
from refast.components import ScrollArea

ScrollArea(
    class_name="h-72 w-48",
    children=[
        # tall content here
    ]
)
```

Hover over the area or scroll inside it to see the scrollbar:

JavaScript

TypeScript

Python

Rust

Go

Java

C++

Swift

Kotlin

Ruby

Scala

Haskell

Elixir

Clojure

Dart

## Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `children` | `list \| Component \| None` | `None` | Scrollable content |
| `type` | `"auto" \| "always" \| "scroll" \| "hover"` | `"hover"` | When the scrollbar is visible |
| `scroll_hide_delay` | `int` | `600` | ms before scrollbar hides (hover/scroll modes) |
| `dir` | `"ltr" \| "rtl" \| None` | `None` | Reading direction (inherits from document) |
| `stick_to_bottom` | `bool` | `False` | Auto-scroll to bottom as content updates |
| `scroll_direction` | `"both" \| "vertical" \| "horizontal"` | `"both"` | Restrict scrolling direction |
| `id` | `str \| None` | `None` | Unique element ID |
| `class_name` | `str` | `""` | Extra Tailwind classes (use for height/width) |

## Notes

Always set a height via `class_name` (e.g. `h-72`). The `type` prop controls
scrollbar visibility:

- `"hover"` — shows on mouse hover
- `"auto"` — shows when content overflows
- `"always"` — always visible
- `"scroll"` — shows while actively scrolling

## Examples

```python
# Vertical list in a fixed height box
ScrollArea(
    class_name="h-80",
    children=[Column(gap=1, children=[Text(item) for item in long_list])],
)

# Horizontal scroll
ScrollArea(
    class_name="w-full",
    children=[
        Row(
            gap=4,
            class_name="w-max",
            children=[Card(...) for _ in range(20)],
        )
    ],
)
```

---

Part of the Refast documentation: [all pages](https://refast.fastapicloud.dev/llms.txt), [everything on one page](https://refast.fastapicloud.dev/llms-full.txt), [search](https://refast.fastapicloud.dev/api/search?q=save_prop).
