Skip to main content

Scroll Area

A custom-styled scrollable container with a thin, minimal scrollbar. Replaces the browser default scrollbar with a sleek, rounded track that blends with your design system while preserving native scroll performance and accessibility.

Live Preview

A scrollable container with a custom thin scrollbar. Scroll to see it in action.

Scrollable Tag List

1React
2TypeScript
3Next.js
4Tailwind CSS
5Framer Motion
6Drizzle ORM
7PostgreSQL
8Node.js
9GraphQL
10Prisma
11Zustand
12Redux Toolkit
13Vite
14Webpack
15ESLint
16Prettier
17Jest
18Vitest
19Playwright
20Docker
21Kubernetes
22AWS
23Vercel
24Supabase
Scroll to see more items

Installation

Install the Aidash Components package using your preferred package manager.

$ pnpm add @aidash/components

Import

Import the ScrollArea component into your file.

tsx
import { ScrollArea } from '@/components/aidash/scroll-area';

Basic Usage

A vertical scroll container displaying a list of users with a thin custom scrollbar.

AC

Alice Chen

Frontend Engineer

BM

Bob Martinez

Backend Developer

CW

Carol White

Product Designer

DK

David Kim

DevOps Engineer

ES

Eva Schmidt

Tech Lead

FJ

Frank Johnson

QA Engineer

GL

Grace Liu

Data Scientist

HP

Henry Park

Mobile Developer

IT

Iris Tanaka

UX Researcher

JB

Jack Brown

Security Engineer

Basic Usage
tsx
<ScrollArea className="max-h-[200px]">
  {users.map(user => (
    <div key={user.name} className="flex items-center gap-3 px-4 py-3">
      <Avatar>{user.avatar}</Avatar>
      <div>
        <p>{user.name}</p>
        <p>{user.role}</p>
      </div>
    </div>
  ))}
</ScrollArea>

Horizontal Scroll

A horizontally scrollable area for wide content like timelines or image galleries.

React

TypeScript

Next.js

Tailwind CSS

Framer Motion

Drizzle ORM

PostgreSQL

Node.js

GraphQL

Prisma

Zustand

Redux Toolkit

Vite

Webpack

ESLint

Prettier

Jest

Vitest

Playwright

Docker

Kubernetes

AWS

Vercel

Supabase

tsx
1<ScrollArea orientation="horizontal">2  <div className="flex gap-3" style={{ width: 'max-content' }}>3    {tags.map(tag => (4      <div key={tag} className="flex-shrink-0 px-4 py-3 rounded-lg">5        {tag}6      </div>7    ))}8  </div>9</ScrollArea>

Both Directions

A container that scrolls in both vertical and horizontal directions, useful for large data grids or code previews.

IDNameRoleDepartmentLocationStatus
001Alice ChenFrontend EngineerEngineeringSan Francisco, CAActive
002Bob MartinezBackend DeveloperEngineeringSan Francisco, CAActive
003Carol WhiteProduct DesignerEngineeringSan Francisco, CAActive
004David KimDevOps EngineerEngineeringSan Francisco, CAActive
005Eva SchmidtTech LeadEngineeringSan Francisco, CAActive
006Frank JohnsonQA EngineerEngineeringSan Francisco, CAActive
007Grace LiuData ScientistEngineeringSan Francisco, CAActive
008Henry ParkMobile DeveloperEngineeringSan Francisco, CAActive
009Iris TanakaUX ResearcherEngineeringSan Francisco, CAActive
010Jack BrownSecurity EngineerEngineeringSan Francisco, CAActive
tsx
1<ScrollArea orientation="both" className="max-h-[220px]">2  <table style={{ width: '800px' }}>3    <thead>4      <tr>5        <th>ID</th>6        <th>Name</th>7        <th>Role</th>8        <th>Department</th>9        <th>Location</th>10        <th>Status</th>11      </tr>12    </thead>13    <tbody>14      {users.map(user => (15        <tr key={user.name}>16          <td>{user.id}</td>17          <td>{user.name}</td>18          ...19        </tr>20      ))}21    </tbody>22  </table>23</ScrollArea>

Custom Scrollbar

A styled thin scrollbar — 6px wide, rounded, semi-transparent — that feels native to the design.

Browser 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

Custom Thin (6px)

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
tsx
1<ScrollArea scrollbarSize={6}>2  {items.map((item, i) => (3    <div key={i} className="px-3 py-2">{item}</div>4  ))}5</ScrollArea>6 7/* The scrollbar renders as:8   - 6px wide, fully rounded9   - Semi-transparent thumb (15% opacity)10   - Transparent track11   - Hover brightens to 25% opacity */
Tip
The scrollbarSize prop controls the scrollbar width for vertical scrolling and height for horizontal scrolling. A value of 4-8 works best for most interfaces.

Auto-hide Scrollbar

The scrollbar fades in when you hover over the container and fades out when you leave. Clean and minimal.

Hover to reveal scrollbar

AC

Alice Chen

Frontend Engineer

BM

Bob Martinez

Backend Developer

CW

Carol White

Product Designer

DK

David Kim

DevOps Engineer

ES

Eva Schmidt

Tech Lead

FJ

Frank Johnson

QA Engineer

GL

Grace Liu

Data Scientist

HP

Henry Park

Mobile Developer

IT

Iris Tanaka

UX Researcher

JB

Jack Brown

Security Engineer

tsx
1<ScrollArea scrollbarVisible="hover" className="max-h-[200px]">2  {users.map(user => (3    <UserCard key={user.name} user={user} />4  ))}5</ScrollArea>6 7/* scrollbarVisible options:8   - "always"  — scrollbar always visible9   - "hover"   — fades in on container hover (default)10   - "scroll"  — visible only while actively scrolling */

With Shadow Indicators

Gradient shadows at the top and bottom edges hint that more content is available above or below.

Scroll to see shadows appear/disappear

React
v1.0
TypeScript
v2.0
Next.js
v3.0
Tailwind CSS
v4.0
Framer Motion
v5.0
Drizzle ORM
v6.0
PostgreSQL
v7.0
Node.js
v8.0
GraphQL
v9.0
Prisma
v10.0
Zustand
v11.0
Redux Toolkit
v12.0
Vite
v13.0
Webpack
v14.0
ESLint
v15.0
Prettier
v16.0
Jest
v17.0
Vitest
v18.0
Playwright
v19.0
Docker
v20.0
Kubernetes
v21.0
AWS
v22.0
Vercel
v23.0
Supabase
v24.0
tsx
1<ScrollArea showShadows className="max-h-[200px]">2  {items.map(item => (3    <div key={item.id} className="flex items-center justify-between">4      <span>{item.name}</span>5      <span>{item.version}</span>6    </div>7  ))}8</ScrollArea>9 10/* Gradient shadows appear/disappear based on scroll position:11   - Top shadow: visible when scrolled down12   - Bottom shadow: visible when more content below */

Props API

Complete list of props accepted by the ScrollArea component.

ScrollArea
PropTypeDefaultDescription
orientation'vertical' | 'horizontal' | 'both''vertical'Scroll direction of the container
scrollbarSizenumber6Width (vertical) or height (horizontal) of the scrollbar track in pixels
scrollbarVisible'always' | 'hover' | 'scroll''hover'When the scrollbar is visible
showShadowsbooleanfalseShow gradient shadow indicators at scroll edges
classNamestring''Additional CSS classes for the scroll container
childrenReactNodeScrollable content
Note
The scrollbarVisible prop controls when the scrollbar appears. Use 'always' for content where scroll position matters, 'hover' for a cleaner look, or 'scroll' for the most minimal approach.

Accessibility

Built-in accessibility features for inclusive scroll experiences.

Focusable Container

The scroll area receives tabindex="0" so keyboard users can focus into it and scroll using arrow keys, Page Up/Down, Home, and End.

Keyboard Scrolling

When focused, the container supports all standard keyboard scroll commands: Arrow Up/Down, Arrow Left/Right (horizontal), Page Up/Down, Home/End.

ARIA Role

Uses role="region" with an accessible label so screen readers announce the scrollable area and its purpose.

Focus Indicator

A visible focus ring appears when the scroll container is focused via keyboard, following the design system focus style.

tsx
1{/* Accessible scroll area with label */}2<ScrollArea aria-label="Team members list" className="max-h-[200px]">3  {members.map(m => <MemberRow key={m.id} member={m} />)}4</ScrollArea>5 6{/* Keyboard navigation:7   Tab      — focus into scroll area8   Arrow    — scroll vertically/horizontally9   PageUp/Down — scroll by page10   Home/End — jump to start/end */}

Components that pair well with ScrollArea.