ScrollArea
A scroll container with themed scrollbars, ready for panels and lists.
Import
import { ScrollArea } from "@tarve/core";Usage
import { ScrollArea, Text } from "@tarve/core";
<ScrollArea orientation="both" style={{ width: 360, height: 220 }}>
<Text style={{ width: 900 }}>
A long line of content that scrolls horizontally as well as vertically inside a themed scroll area.
</Text>
</ScrollArea>Props
ScrollArea has no props of its own beyond the inherited and common props below.
Inherited from ViewProps 11 props
| Prop | Type | Default |
|---|---|---|
align | Style["align"] | — |
dismissOnOutside | boolean | — |
dragRegion | boolean | — |
flex | number | — |
focusable | boolean | — |
gap | number | — |
justify | Style["justify"] | — |
onOutsideClick | () => void | — |
padding | Style["padding"] | — |
portal | boolean | — |
windowAction | "minimize" | "toggleMaximize" | "close" | — |
Inherited from ScrollProps 4 props
| Prop | Type | Default |
|---|---|---|
onScroll | (offset: number, max: number) => void | — |
onScrollPosition | (position: ScrollPosition) => void | — |
orientation | ScrollOrientation | — |
speed | number | — |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyleTypes
type ScrollOrientation = "vertical" | "horizontal" | "both";interface ScrollPosition { x: number; y: number; maxX: number; maxY: number }