- Docs
- Components
- Layout
Scroll area
A scrolling region with Qeetrix scrollbars; it takes keyboard focus when its content overflows.
- Import
- @qeetrix/react
- Status
- StableSince 0.0.2
- Renders
<div role="region">Server-rendered- Tested
- WCAG 2.2 AAaxe on every pull request
01
Import
// From the package: a build keeps only what it uses.
import { ScrollArea } from "@qeetrix/react";
// Or from its own path.
import { ScrollArea } from "@qeetrix/react/scroll-area";02
Props
And every native attribute of the element it renders.
| Prop | Type | Default | What it does |
|---|---|---|---|
orientation | "vertical" | "horizontal" | "both" | "vertical" | Which way it scrolls. |
aria-label · aria-labelledby | string | — | Names the region; it goes on the viewport, which becomes a region landmark. |
className · style | … | — | Its size, e.g. blockSize: 320, and its placement. |
children | ReactNode | — | What scrolls. |
03
Parts
Each part carries a data-slot, for tests and placement.
| data-slot | Element | What it is |
|---|---|---|
scroll-area | <div> | The root. |
scroll-area-viewport | <div role="region"> | Named: role region, focusable when it overflows. |
scroll-area-scrollbar | <div> | data-orientation. |
scroll-area-thumb | <div> | The thumb. |
04
A long value
A URL or a key wider than its box: sideways, named for what it holds, by keyboard too.
<ScrollArea orientation="horizontal" aria-label="Authorization URL">
<code>{authorizationUrl}</code>
</ScrollArea>