Overrides

Scroll Area

Extended Features

Install

Configure your registry in components.json:

{
  "registries": {
    "@uxio": "https://ui.uxio.dev/r/styles/{style}/{name}.json"
  }
}

Then run:

npx shadcn@latest add @uxio/scroll-area

Usage

The scrollbar prop controls which scrollbars are shown: "vertical" (default), "horizontal", or "both".

import { ScrollArea } from "@/components/ui/scroll-area"

export function ScrollAreaVertical() {
  return (
    <ScrollArea scrollbar="vertical">
      {Array.from({ length: 24 }, (_, i) => (
        <p key={i}>Row {i + 1}</p>
      ))}
    </ScrollArea>
  )
}

export function ScrollAreaHorizontal() {
  return (
    <ScrollArea scrollbar="horizontal">
      <p>{"Long content ".repeat(30)}</p>
    </ScrollArea>
  )
}

export function ScrollAreaBothAxes() {
  return (
    <ScrollArea scrollbar="both">
      {Array.from({ length: 16 }, (_, i) => (
        <p key={i}>
          Row {i + 1}
          {" …".repeat(50)}
        </p>
      ))}
    </ScrollArea>
  )
}

Examples

Vertical (default)

Shows only the vertical scrollbar, matching the upstream default.

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Item 13
Item 14
Item 15
Item 16
Item 17
Item 18
Item 19
Item 20
Item 21
Item 22
Item 23
Item 24

Horizontal

Use scrollbar="horizontal" for wide content inside a fixed-width container.

1
2
3
4
5
6
7
8
9
10
11
12

Both

Use scrollbar="both" when content overflows on both axes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48