ScrollArea
Scrollable region with thin themed scrollbar, keyboard focusable.
Code
import * as React from 'react';
import { ScrollArea, Timeline } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 320,
}}
>
<ScrollArea maxHeight={130} label="Changelog">
<Timeline
items={[
{
title: 'v0.3.0',
description: 'Autocomplete, tags, forms',
},
{
title: 'v0.2.0',
description: 'DM Sans',
},
{
title: 'v0.1.0',
description: 'Initial release',
},
{
title: 'v0.0.1',
description: 'Canvas',
},
]}
/>
</ScrollArea>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { ScrollArea } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/scroll-area.jsonGuidelines
- Give it a
labelfor screen readers.
Props
| Prop | Type | Required |
|---|---|---|
maxHeight | number | string | No |
label | string | No |
className | string | No |
style | React.CSSProperties | No |
children | React.ReactNode | No |