Scroll Area
ScrollArea: native scrolling with styled scrollbars, edge state and follow-to-end, keyboard-reachable when it overflows. Its own primitive, written for speed from UI SDK's.
Example
- Run #1240
- Run #1241
- Run #1242
- Run #1243
- Run #1244
- Run #1245
- Run #1246
- Run #1247
- Run #1248
- Run #1249
- Run #1250
- Run #1251
- Run #1252
- Run #1253
- Run #1254
- Run #1255
- Run #1256
- Run #1257
- Run #1258
- Run #1259
scroll-area-demo.tsxCopy code
Installation
Copy code
Brings alongnarrow
Usage
ImportCopy code
API reference
ScrollArea
Takes ComponentProps.
ScrollAreaViewport
Takes ComponentProps.
ScrollAreaContent
Takes ComponentProps.
ScrollAreaCorner
Takes ComponentProps.
ScrollAreaScrollToEnd
Takes ComponentProps.
ScrollAreaScrollbar
| Prop | Type | Default |
|---|---|---|
orientation | Orientation | "vertical" |
Also takes PartProps.
ScrollAreaThumb
Takes PartProps.
Other exports
createScrollAreaControllerscrollAreacreateScrollViewcreateStyleWriterdraggedPositionlistenedgeToleranceedgesOffocusViewportisEditingmainAxismaxScrollnamesoverflowspageDirectionpageFractionpositionAtprefersReducedMotionregisterFrameVariablesscaleOfscrollbarShownscrollsInsidestartwardKeysthumbGeometrytrackPointwheelPixelscreateScrollbarInputbindTabStoplayersBesideViewportwindowScrollertype Orientationtype ScrollAreaControllertype ScrollAreaOptionstype ScrollAreaScrollbarStatetype ScrollAreaThumbStatetype Axistype Metricstype ScrollAreaModeltype ScrollAreaScrollOptionstype ScrollAreaStoretype ScrollAreaTypetype ScrollViewQueriesAccessibility
- Native scrolling, so keyboard, wheel and touch work; name a focusable viewport when it holds content.
- An overflowing viewport with nothing focusable inside is a tab stop, so keyboard users can reach it.
Agent actions
Agents scroll it to its start or end (scrollToStart, scrollToEnd).
Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.