ScrollArea

Contêiner rolável com estilo personalizado baseado no Radix UI, com scrollbar temática e suporte a eixos vertical, horizontal ou ambos.

Demonstração

Vertical

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12
Item 13
Item 14
Item 15
Item 16
Item 17
Item 18
Item 19
Item 20

Horizontal

ReactTypeScriptNext.jsTailwindRadix UIStorybookVitestTurborepo

Props

PropTipoPadrãoDescrição
orientation'vertical' | 'horizontal' | 'both''vertical'Which scrollbar(s) to render.
childrenReact.ReactNodeScrollable content.
classNamestringExtra CSS class on the root element.

Uso

import { ScrollArea } from '@ghiberti85/ui'

// Vertical (default)
<ScrollArea style={{ height: 200 }}>
  {items.map(i => <div key={i}>{i}</div>)}
</ScrollArea>

// Horizontal
<ScrollArea orientation="horizontal" style={{ width: 300 }}>
  <div style={{ display: 'flex', gap: 8, width: 'max-content' }}>
    {tags.map(t => <span key={t}>{t}</span>)}
  </div>
</ScrollArea>

// Both axes
<ScrollArea orientation="both" style={{ height: 200, width: 300 }}>
  <div style={{ width: 600, height: 600 }}>Large content</div>
</ScrollArea>

Ver no Storybook

Abrir no Storybook
Ghiberti UI — Design System