组件
滚动区域 Scroll Area
ScrollArea:滚动区域。用低调的墨色滚动条替代原生滚动条,悬停和滚动时显示。部件:Root、Viewport、Content、Scrollbar、Thumb、Corner。
#基础用法
The ground rests in ambient shade, and content is laid down as ink. Hierarchy rises from light, never from boxes or heavy rules.
Surfaces keep a quiet ladder — the page, the card, the vessel — and hairlines divide where a heavier stroke would shout.
Motion obeys the same grammar: shadows settle slowly, panels dissolve in, and the hand is never hurried.
<script setup lang="ts">
import { ScrollArea } from "@bysages/vue";
</script>
<template>
<ScrollArea.Root class="h-30">
<ScrollArea.Viewport>
<ScrollArea.Content>
<p>
The ground rests in ambient shade, and content is laid down as ink. Hierarchy rises from
light, never from boxes or heavy rules.
</p>
<p>
Surfaces keep a quiet ladder — the page, the card, the vessel — and hairlines divide where
a heavier stroke would shout.
</p>
<p>
Motion obeys the same grammar: shadows settle slowly, panels dissolve in, and the hand is
never hurried.
</p>
</ScrollArea.Content>
</ScrollArea.Viewport>
<ScrollArea.Scrollbar>
<ScrollArea.Thumb />
</ScrollArea.Scrollbar>
<ScrollArea.Corner />
</ScrollArea.Root>
</template>
#属性
#Content
纯造型的部件——自身没有属性,沿用部件结构的共享样式。
#Corner
纯造型的部件——自身没有属性,沿用部件结构的共享样式。
#Root
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
id | string | 组件内部状态机的唯一标识 | |
ids | Partial<{ root: string; viewport: string; content: string; scrollbar: string; thumb: string; }> | 滚动区域各元素的 id |
#Scrollbar
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
orientation | Orientation | — |
#Thumb
纯造型的部件——自身没有属性,沿用部件结构的共享样式。
#Viewport
纯造型的部件——自身没有属性,沿用部件结构的共享样式。