Y2K UI

ScrollArea

A flat Y2K-styled scroll area built on top of Radix UI's ScrollArea primitive. It provides a thick navy border, a white viewport, and a custom pastel-blue scrollbar with a thick navy outline.

scroll-area-demo.app

Scrollable List

This panel scrolls — try it out!

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

Installation

terminal.sh
npx y2kui@latest add scroll-area

Usage

import {
  ScrollArea,
  ScrollAreaViewport,
  Scrollbar,
  ScrollThumb,
  ScrollCorner,
} from "@/components/ui/scroll-area"

export function Example() {
  return (
    <ScrollArea className="h-48 w-80">
      <ScrollAreaViewport>
        {/* Your scrollable content goes here */}
        <div className="space-y-2 p-4">
          {items.map((item) => (
            <div key={item.id}>{item.label}</div>
          ))}
        </div>
      </ScrollAreaViewport>
      <Scrollbar orientation="vertical" />
    </ScrollArea>
  )
}

Props

ScrollArea

PropTypeDefaultDescription
classNamestringAdditional CSS classes to merge onto the root container.
type"auto" | "always" | "scroll" | "hover""hover"Describes the nature of the scrollbar visibility.
scrollHideDelaynumber600Duration (in ms) before the scrollbar hides when type is `"hover"`.
dir"ltr" | "rtl"Reading direction of the scroll area.

ScrollAreaViewport

PropTypeDefaultDescription
classNamestringAdditional CSS classes to merge onto the viewport.

Scrollbar

PropTypeDefaultDescription
classNamestringAdditional CSS classes to merge onto the scrollbar track.
orientation"vertical" | "horizontal""vertical"The orientation of the scrollbar.

ScrollThumb

PropTypeDefaultDescription
classNamestringAdditional CSS classes to merge onto the scrollbar thumb.

ScrollCorner

PropTypeDefaultDescription
classNamestringAdditional CSS classes to merge onto the corner element.

Examples

Horizontal scroll

Also supports horizontal scrolling via the orientation prop.

scroll-area-horizontal-demo.app
Star
Moon
Sun
Pixel
Neon
Cyber
Pastel
Wave
Spark
Retro

Always visible scrollbar

Set type="always" to keep the scrollbar always visible.

scroll-area-always-demo.app
Row #1
Row #2
Row #3
Row #4
Row #5
Row #6
Row #7
Row #8
Row #9
Row #10
Row #11
Row #12

On this page