Prodular UI

Scroll area

A scroll container with a slim themed scrollbar that stays out of the way until you hover or scroll.

npx prodular-ui add scroll-area

Vertical

A fixed height panel with a long list.

Horizontal

Add ScrollBar orientation="horizontal" and give the content w-max.

Anatomy

<ScrollArea className="h-72">  <div className="p-4">...</div></ScrollArea>

Guidance

Use it when

  • Fixed height regions inside a layout: a side panel, a popover list, a log.
  • Horizontal rows of items that do not wrap.

Avoid

  • The whole page. Let the document scroll natively.
  • Nested scroll areas in the same direction.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Give ScrollArea a fixed height (h-72) or max height for vertical scrolling. Without it nothing scrolls.
  • For horizontal scrolling, add <ScrollBar orientation="horizontal" /> as a child and make the content w-max.
  • Put padding on the content inside the ScrollArea, not on the ScrollArea itself, so the scrollbar sits at the edge.
  • The viewport is focusable for keyboard scrolling. Do not remove its focus ring.

API

ScrollArea

PropTypeDefaultDescription
classNamestringSize of the scroll region, for example h-72.

ScrollBar

PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"Which scrollbar to render. The vertical one is included by default.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add scroll-area# or, with the registry in components.jsonnpx shadcn@latest add @prodular/scroll-area