Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Scroll Area

Augments native scroll functionality for custom, cross-browser styling.

Tags

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

Installation

npx logic2b@next add scroll-area

Usage

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

<ScrollArea className="h-72 w-48 rounded-md border">
  Jokester began sneaking into the castle in the middle of the night...
</ScrollArea>

Set the viewport size with className (height/width) — the content scrolls inside it. For horizontal scrolling, render a ScrollBar with orientation="horizontal" inside the ScrollArea.

Accessibility

The viewport is keyboard-focusable by default, so arrow, Page Up/Down, Home and End scrolling remain available even when its content has no interactive descendants. The visible focus ring identifies which scroll region owns those keys.

Examples

Horizontal

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

Long text

Terms of Service

By accessing this registry you agree to copy, adapt, and ship these components in your own projects without attribution.

Components are provided as-is. You own the code once it lands in your repository and are free to modify every token, variant, and style.

Updates are opt-in: re-run the installer whenever you want the latest version of a component, then reconcile any local changes.

Accessibility primitives are inherited from the underlying libraries. Test your own compositions before shipping to production.

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<ScrollArea
  className="h-48 w-full max-w-md rounded-lg border"
  aria-label="Release notes"
>
  <div
    className="space-y-4 p-4"
  >
    <p
      className="font-medium"
    >Release 1.2</p>
    <p
      className="text-sm text-muted-foreground"
    >Versioned registry manifests and integrity checks.</p>
    <p
      className="font-medium"
    >Release 1.1</p>
    <p
      className="text-sm text-muted-foreground"
    >Portable design tokens for web, iOS and Android.</p>
    <p
      className="font-medium"
    >Release 1.0</p>
    <p
      className="text-sm text-muted-foreground"
    >The first stable component registry.</p>
  </div>
</ScrollArea>

API reference

Generated from the public TypeScript exports in src/ui/scroll-area.tsx.

View JSON

ScrollArea

Component
Props: React.ComponentProps<typeof ScrollAreaPrimitive.Root>

ScrollBar

Component
Props: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
PropTypeRequiredDefaultDescription
orientation"horizontal" | "vertical"No"vertical"—

Accessibility contract

Machine-readable behavior and consumer responsibilities for scroll-area.

View JSON
Support
Primitive-managed
Pattern
scrollable region
Radix Scroll Area
Keyboard interactions for scroll-area
KeysBehavior
ArrowUp ArrowDown ArrowLeft ArrowRight PageUp PageDownScroll a focused scroll container with the keyboard.

Built-in semantics

  • Preserves the semantics of its children while providing custom visual scrollbars.

Consumer responsibilities

  • Make the viewport focusable and label it only when the region itself needs keyboard scrolling or landmark semantics.