Layout
ScrollArea
Keep a long activity list or a row of filters inside a named region with native scrolling.
import { ScrollArea } from '@reactloom/ui';Examples
Vertical order activity
- Quote approved by Finance
- Purchase order sent to vendor
- Delivery confirmed by Operations
- Invoice added to the payment queue
- Payment scheduled for Friday
- Receipt uploaded to the order
import { ScrollArea } from '@reactloom/ui';
const activity = [
'Quote approved by Finance',
'Purchase order sent to vendor',
'Delivery confirmed by Operations',
'Invoice added to the payment queue',
'Payment scheduled for Friday',
'Receipt uploaded to the order',
];
export default function Example() {
return (
<ScrollArea aria-label="Order activity" stableGutter style={{ maxBlockSize: '8rem', inlineSize: '100%' }}>
<ol>{activity.map((entry) => <li key={entry} style={{ paddingBlock: '0.5rem' }}>{entry}</li>)}</ol>
</ScrollArea>
);
}Horizontal customer segments
New customersRenewing accountsAt-risk accountsEnterprise trialsSelf-service upgrades
import { ScrollArea, Stack, Tag } from '@reactloom/ui';
const segments = ['New customers', 'Renewing accounts', 'At-risk accounts', 'Enterprise trials', 'Self-service upgrades'];
export default function Example() {
return (
<ScrollArea aria-label="Customer segments" orientation="horizontal" style={{ maxInlineSize: '20rem' }}>
<Stack direction="row" gap="3" style={{ padding: '0.25rem' }}>
{segments.map((label) => <Tag key={label}>{label}</Tag>)}
</Stack>
</ScrollArea>
);
}API reference
| Prop | Type | Default |
|---|---|---|
aria-label · aria-labelledbyrequiredSupply a label or reference a visible heading. | string | — |
orientationAxes that can scroll. | 'vertical' | 'horizontal' | 'both' | 'vertical' |
stableGutterReserve room for classic scrollbars. | boolean | false |
tabIndexDefaults to a tab stop when the region overflows. | number | — |
refReferences the scrolling viewport. | Ref<HTMLDivElement> | — |
Customization
Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.
State attributes
Target these in your CSS to style states without depending on class names.
| Attribute | Values |
|---|---|
[data-orientation] | present when on |
[data-stable-gutter] | present when on |
Theme tokens it reads
--pl-focus-ring-color --pl-focus-ring-width
Accessibility
An overflowing region becomes a tab stop. The browser handles scroll gestures and keyboard scrolling, including the reading direction.
| Key | Action |
|---|---|
| Tab | Focus the scrolling viewport or a control inside it |
| Arrow keys or Page Up / Down | Scroll in supported directions |
Usage guidelines
Do
- Constrain the block size, inline size, or both to establish a scrollable viewport.
Don’t
- Avoid nesting several scroll regions in the same direction.