Scroll area

Playground

Properties

Direction

Usage

Set the width and height in your app. Use vertical or horizontal for one direction, or concurrently for both.

'use client';
import { ScrollArea } from '@mbsw/ui';

export default function Example() {
  return (
    <ScrollArea
      style={{ height: 240, width: 320, maxWidth: '100%' }}
      viewportProps={{ role: 'region', 'aria-label': "Content list" }}
    >
      {Array.from({ length: 20 }, (_, index) => (
        <p key={index}>content {index + 1}</p>
      ))}
    </ScrollArea>
  );
}

The Playground Code tab includes the full example with your current settings. See Installation for the CSS imports.

Composition