Skip to content

Scroll Area ​

A neo-brutalist styled scroll area built on reka-ui's ScrollArea primitives, featuring custom scrollbar styling.

Demo ​

Preview

通知

Alice Chen 赞了你的帖子

2 分钟前

Bob Wang 给你发了消息

5 分钟前

Carol Li 收藏了你的仓库

12 分钟前

David Liu 关注了你

30 分钟前

Eva Zhang 提到了你

1 小时前

Frank Wu 批准了你的 PR

2 小时前

Grace He 评论了议题

3 小时前

Henry Xu 邀请你加入团队

5 小时前

Ivy Zhao 部署到生产环境

8 小时前

Jack Sun 审查了你的代码

1 天前

标签

标签 1标签 2标签 3标签 4标签 5标签 6标签 7标签 8标签 9标签 10标签 11标签 12标签 13标签 14标签 15标签 16标签 17标签 18标签 19标签 20

变体

default
项目 1
项目 2
项目 3
项目 4
项目 5
项目 6
项目 7
项目 8
项目 9
项目 10
项目 11
项目 12
primary
项目 1
项目 2
项目 3
项目 4
项目 5
项目 6
项目 7
项目 8
项目 9
项目 10
项目 11
项目 12
accent
项目 1
项目 2
项目 3
项目 4
项目 5
项目 6
项目 7
项目 8
项目 9
项目 10
项目 11
项目 12

尺寸

sm
项目 1
项目 2
项目 3
项目 4
项目 5
项目 6
项目 7
项目 8
项目 9
项目 10
项目 11
项目 12
default
项目 1
项目 2
项目 3
项目 4
项目 5
项目 6
项目 7
项目 8
项目 9
项目 10
项目 11
项目 12
lg
项目 1
项目 2
项目 3
项目 4
项目 5
项目 6
项目 7
项目 8
项目 9
项目 10
项目 11
项目 12

Installation ​

pnpm dlx brutx-vue@latest add scroll-area

Usage ​

vue
<script setup>
import { ScrollArea } from 'brutx-ui-vue'
</script>

<template>
    <ScrollArea class="h-72 w-48 border-3 border-brutal">
        <div class="p-4">
            <h4 class="mb-4 text-sm font-black leading-none">Tags</h4>
            <div class="space-y-1">
                <div v-for="tag in tags" :key="tag" class="text-sm font-medium">
                    {{ tag }}
                </div>
            </div>
        </div>
    </ScrollArea>
</template>

Horizontal Scrolling ​

vue
<script setup>
import { ScrollArea, ScrollBar } from 'brutx-ui-vue'
</script>

<template>
    <ScrollArea class="w-96 border-3 border-brutal">
        <div class="flex w-max space-x-4 p-4">
            <div v-for="artwork in artworks" :key="artwork" class="shrink-0">
                <div class="h-[250px] w-[200px] border-3 border-brutal bg-brutal-muted" />
            </div>
        </div>
        <ScrollBar orientation="horizontal" />
    </ScrollArea>
</template>

Variants ​

Controls the scrollbar track and thumb colors. ScrollArea reserves space for the default vertical scrollbar so the content keeps its width as the scrollbar appears and disappears. Set the variant on ScrollBar for a manually added horizontal scrollbar.

VariantTrackThumb
defaultbg-brutal-bgbg-brutal-fg
primarybg-brutal-primarybg-brutal-primary-foreground
accentbg-brutal-accentbg-brutal-accent-foreground
vue
<script setup>
import { ScrollArea } from 'brutx-ui-vue'

const tags = Array.from({ length: 20 }, (_, i) => `Tag ${i + 1}`)
</script>

<template>
    <ScrollArea variant="primary" class="h-72 w-48 border-3 border-brutal">
        <div class="p-4 space-y-1">
            <div v-for="tag in tags" :key="tag" class="text-sm font-medium">
                {{ tag }}
            </div>
        </div>
    </ScrollArea>
</template>

Sizes ​

Controls the scrollbar thickness (via the --scroll-thickness token).

SizeThickness
sm0.5rem
default0.75rem
lg1rem
vue
<script setup>
import { ScrollArea } from 'brutx-ui-vue'

const tags = Array.from({ length: 20 }, (_, i) => `Tag ${i + 1}`)
</script>

<template>
    <ScrollArea size="lg" class="h-72 w-48 border-3 border-brutal">
        <div class="p-4 space-y-1">
            <div v-for="tag in tags" :key="tag" class="text-sm font-medium">
                {{ tag }}
            </div>
        </div>
    </ScrollArea>
</template>

Sub-components ​

ComponentDescription
ScrollAreaRoot scrollable container
ScrollBarCustom scrollbar (vertical by default, supports horizontal)

API Reference ​

ScrollArea

ScrollArea — Props
NameTypeDefaultDescription
variant
"accent" | "default" | "primary" | undefined
"default"
Selects the default, primary, or accent color variant for the scrollbar and thumb, passed to the internal ScrollBar.
Details

Declared type

NonNullable<"default" | "primary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"

Default value details

Resolved value
"default"

Source

ScrollArea.vue:16

packages/ui/src/components/scroll-area/ScrollArea.vue

size
"default" | "lg" | "sm" | undefined
"default"
Selects the thickness of the internal scrollbar and passes it to ScrollBar.
Details

Declared type

NonNullable<"default" | "lg" | "sm" | null | undefined> | undefined

Literal values

  • "default"
  • "lg"
  • "sm"

Default value details

Resolved value
"default"

Source

ScrollArea.vue:17

packages/ui/src/components/scroll-area/ScrollArea.vue

class
string | undefined
undefined
Custom CSS classes appended to the Reka UI scroll-area root element.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

ScrollArea.vue:18

packages/ui/src/components/scroll-area/ScrollArea.vue

viewportClass
string | undefined
undefined
Custom CSS classes appended to the scrollable viewport element.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

ScrollArea.vue:19

packages/ui/src/components/scroll-area/ScrollArea.vue

ScrollArea — Slots
NameSignature or typeDescription
#default
{}
Contains the content rendered in the scrollable viewport.
Details

Declared type

{}

Source

ScrollArea.vue

packages/ui/src/components/scroll-area/ScrollArea.vue

ScrollBar

ScrollBar — Props
NameTypeDefaultDescription
orientation
"vertical" | "horizontal" | undefined
"vertical"
Selects a vertical or horizontal scrollbar orientation.
Details

Declared type

"vertical" | "horizontal" | undefined

Literal values

  • "horizontal"
  • "vertical"

Default value details

Resolved value
"vertical"

Source

ScrollBar.vue:14

packages/ui/src/components/scroll-area/ScrollBar.vue

variant
"accent" | "default" | "primary" | undefined
"default"
Selects the default, primary, or accent color variant for the scrollbar and thumb.
Details

Declared type

NonNullable<"default" | "primary" | "accent" | null | undefined> | undefined

Literal values

  • "accent"
  • "default"
  • "primary"

Default value details

Resolved value
"default"

Source

ScrollBar.vue:15

packages/ui/src/components/scroll-area/ScrollBar.vue

size
"default" | "lg" | "sm" | undefined
"default"
Selects the scrollbar thickness.
Details

Declared type

NonNullable<"default" | "lg" | "sm" | null | undefined> | undefined

Literal values

  • "default"
  • "lg"
  • "sm"

Default value details

Resolved value
"default"

Source

ScrollBar.vue:16

packages/ui/src/components/scroll-area/ScrollBar.vue

class
string | undefined
undefined
Custom CSS classes appended to the Reka UI scrollbar element.
Details

Declared type

string | undefined

Default value details

Resolved value
undefined

Source

ScrollBar.vue:17

packages/ui/src/components/scroll-area/ScrollBar.vue

Accessibility ​

  • Keyboard operation: Supports keyboard arrow keys, Page Up/Down, Home/End keys for scrolling content
  • ARIA attributes: The scroll area automatically sets role="region" and aria-label; the scrollbar sets appropriate ARIA attributes
  • Scrollbar interaction: The scrollbar thumb supports mouse dragging and keyboard operation, with visible focus indicators
  • Content overflow: When content overflows, screen readers can identify the scrollable area and provide navigation hints

Brute force builds.