DocsComponentsTemplatesThemesGitHub

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.json

Guidelines

  • Give it a label for screen readers.

Props

PropTypeRequired
maxHeightnumber | stringNo
labelstringNo
classNamestringNo
styleReact.CSSPropertiesNo
childrenReact.ReactNodeNo

Edit this example on GitHub