---
title: "Scroller"
description: "A row that scrolls sideways, with a soft fade and a chevron at each edge that hides content."
url: https://gelatinui.com/components/scroller
markdown_url: https://gelatinui.com/components/scroller.md
access: free
install: "npx shadcn@latest add @gelatin-ui/scroller"
registry_item: https://gelatinui.com/r/scroller.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Scroller

> A row that scrolls sideways, with a soft fade and a chevron at each edge that hides content.

Page: https://gelatinui.com/components/scroller

## When to use it

Best for: A row of tabs or chips that can grow wider than its box and must not wrap.

- Put the row in `ScrollerContent`, and add `ScrollerPrevious` and `ScrollerNext`.
- Use `variant="track"` for segmented Tabs or a Segmented Control: the root draws the track.
- Use `disabled` for a row that scrolls only in one mode, such as a phone layout.
- Use `dragScroll` when mouse users should drag the row as on touch.

## When not to use it

- To fold the items that do not fit into a menu, use the [Overflow List](https://gelatinui.com/components/overflow-list.md).
- For slides that move one stop at a time, use the [Carousel](https://gelatinui.com/components/carousel.md).

## Notes for agents

- Each fade and chevron shows only while its side hides content (Base UI overflow attributes).
- The chevrons are for the pointer and are not tab stops; they hide on touch.
- The scroll box is not a tab stop. Set `tabIndex={0}` on `ScrollerContent` for plain text.
- A pressed or focused item half under a fade scrolls clear of it; the selected tab stays in view.
- `keepVisible` on a control keeps it on screen, dimmed when its side hides nothing.

## Anatomy

```text
Scroller
├─ ScrollerContent (0..n)
├─ ScrollerPrevious (0..n)
└─ ScrollerNext (0..n)
```

## API reference

### Scroller

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `focusRing` | `"inset" \| "outside"` |  | Where the focus ring sits when the Viewport has keyboard focus: `outside` (default) or `inset`, for a Scroll Area in a parent that clips or with a `sticky` child (`scrollFocusVariants` in `#/lib/scroll-focus`). |
| `scrollAmount` | `number` |  | Pixels one press of a control scrolls. Default: 80% of the visible width. |
| `dragScroll` | `boolean` | false | Scroll by a mouse drag on the row, as on touch. Off by default: a drag on a row of links or chips then also scrolls, and a press that moves more than 4px is not a click. |
| `disabled` | `boolean` | false | Render the children as they are: no scroll box, fades, or controls. For a row that scrolls only in one mode (a phone layout, a `scroll` prop), with one tree for both modes. |
| `variant` | `"plain" \| "track"` | "plain" | `track`: the root draws the muted segmented track (Tabs `default`, Segmented Control) and the fade takes its color; the row's own child drops its fill, so one track shows and the scroll box never cuts it with square ends. `plain` (default): no surface. |
| `rounded` | `"default" \| "full"` | "default" | The corner of the `track`: `default` (10px, the 32px track) or `full` (a pill). |

Also takes every prop of Base UI `ScrollArea.Root`: https://base-ui.com/react/components/scroll-area

### ScrollerContent

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  | Classes of the row inside the scroll box (gap, padding, alignment). |

### ScrollerPrevious

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `keepVisible` | `boolean` |  | Keep the button on screen when its side hides nothing, dimmed and not pressable, so a row of buttons does not jump. The fade still goes, so it never covers the first or last item. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### ScrollerNext

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |
| `keepVisible` | `boolean` |  | Keep the button on screen when its side hides nothing, dimmed and not pressable, so a row of buttons does not jump. The fade still goes, so it never covers the first or last item. |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Scroller | `scroller` | `data-part` | `--card`, `--muted`, `--popover`, `--scroller-fade`, `--scroller-surface`, `--sidebar` |  |
| ScrollerContent | `scroller-content` | `data-dragging` |  |  |
| ScrollerPrevious | `scroller-previous` |  |  |  |
| ScrollerNext | `scroller-next` |  |  |  |

## Usage

Put the row in the content part, and add the two controls.

The sample also uses `tabs`, which this add does not write. One command adds them with this item:

```bash
npx shadcn@latest add @gelatin-ui/scroller @gelatin-ui/tabs
```

```tsx title="project-tabs.tsx"
import { Scroller, ScrollerContent, ScrollerNext, ScrollerPrevious } from "@/components/ui/scroller";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";

export function ProjectTabs() {
  return (
    <Tabs defaultValue="overview">
      <Scroller variant="track">
        <ScrollerContent>
          <TabsList aria-label="Project">
            <TabsTrigger value="overview">Overview</TabsTrigger>
            <TabsTrigger value="activity">Activity</TabsTrigger>
            <TabsTrigger value="pull-requests">Pull requests</TabsTrigger>
            <TabsTrigger value="deployments">Deployments</TabsTrigger>
            <TabsTrigger value="settings">Settings</TabsTrigger>
          </TabsList>
        </ScrollerContent>
        <ScrollerPrevious />
        <ScrollerNext />
      </Scroller>
    </Tabs>
  );
}
```

## Compose

Rules:

- Group with a Frame (`group-in-frames`): Put related panels in one `Frame` with its header and footer outside the panels, and keep a plain `Card` for one block of content.
- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/scroller
```

It adds 20 registry items: 16 files, 3439 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Button](https://gelatinui.com/components/button.md)
- [Scroll Area](https://gelatinui.com/components/scroll-area.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Scroll Area](https://gelatinui.com/components/scroll-area.md)
- [Tabs](https://gelatinui.com/components/tabs.md)
- [Toggle Group](https://gelatinui.com/components/toggle-group.md)

## Keyboard

| Keys | Action |
| --- | --- |
| Tab, arrow keys | Move focus in the row; the focused item scrolls into view. |

## Motion

| Part | Motion |
| --- | --- |
| Edge | hover · the fade and the chevron show and hide on opacity |
