MiHCM
layout/@mihcm/ui·v0.21.0·stable

ScrollArea

Custom-styled scrollable container with thin translucent scrollbars. Powered by Radix.

Use cases

  • Constrained lists — a fixed-height container for long tag lists, menus, or log output.
  • Horizontal scrolling — a row of cards or thumbnails that overflows horizontally.
  • Custom scrollbar styling — thin, translucent scrollbars that match the design system.

When NOT to use

  • Full-page scroll → use the browser's native scroll. ScrollArea is for contained regions.
  • Virtualized lists with 1000+ items → use a virtualized list component.

Key props

ScrollArea accepts all standard Radix ScrollArea root props plus className and children.

PropTypeDescription
classNamestringApplied to the root container. Set height/width here.
childrenReactNodeScrollable content.

Scrollbars

Both vertical and horizontal scrollbars are included automatically. They appear on hover/scroll and fade out. The track is transparent; the thumb is bg-border (thin and translucent).

Anatomy

<ScrollArea className="h-72">
  {/* content */}
</ScrollArea>

ScrollBar is also exported for custom orientations if needed.

Composition

  • Set a fixed h-* or max-h-* on the root — without a height constraint, ScrollArea has nothing to scroll.
  • Wrap a Table in ScrollArea for responsive horizontal overflow on narrow viewports.
  • Nest inside a Card for bounded content panels (e.g. a log viewer, a tag picker).
  • Table — tables benefit from wrapping in ScrollArea for horizontal overflow.
  • Carousel — horizontal sliding with prev/next controls instead of free scroll.