codefast/ui

Command Palette

Search for a command to run...

Layout

Scroll Area

Custom-styled scrollbar that matches your design system. Hides native OS scrollbars.

Install

pnpm add @codefast/ui

Import path

@codefast/ui/scroll-area

Examples

Horizontal

Use ScrollBar with orientation='horizontal' for horizontal scrolling.

Ornella Binni
Photo by Ornella Binni
Tom Byrom
Photo by Tom Byrom
Vladimir Malyavko
Photo by Vladimir Malyavko

RTL

Right-to-left layout support for languages such as Arabic and Hebrew.

Translations are AI-generated for demonstration and may be imperfect.

العلامات

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

Anatomy

How the parts compose. Copy this skeleton and fill in the slots.

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

<ScrollArea className="h-44 w-48">
  …long content…
</ScrollArea>

API reference

Props for each part of the component. All native element props are also forwarded.

ScrollArea

A viewport with a styled scrollbar that replaces the native one.

PropTypeDefaultDescription
classNamestringSet the fixed size (e.g. h-44 w-48) the content scrolls within.

ScrollAreaScrollbar

PropTypeDefaultDescription
orientation"vertical" | "horizontal"Render a horizontal scrollbar in addition to the vertical one.

Accessibility

Built to be keyboard-navigable and screen-reader friendly out of the box.

  • The viewport stays keyboard-scrollable and focusable as normal.
  • Custom scrollbars are visual; native scroll behaviour is preserved underneath.
  • Ensure content has enough contrast against the scroll surface.

Guidelines

Conventions that keep usage consistent across an app.

Do

  • Use for constrained lists, menus, and panels.
  • Give the area a clear fixed size so the scrollbar makes sense.

Don’t

  • Don’t wrap the whole page — let it scroll natively.
  • Don’t hide that content is scrollable; show a peek of the next row.