ScrollArea Pro

Advanced ScrollArea with auto-hide scrollbars, progress bars, and cross-axis scroll.

Loading...

Installation

npx shadcn@latest add @scrollxui/scroll-areapro 

Usage

import { ScrollAreaPro } from '@/components/ui/scroll-areapro';
<ScrollAreaPro
  className='w-96 rounded-md border whitespace-nowrap'
  crossDirectionalScroll
  showProgress='horizontal'
>
  <div className='flex w-max space-x-4 p-4'>
    {works.map((artwork) => (
      <figure key={artwork.artist} className='shrink-0'>
        <div className='overflow-hidden rounded-md'>
          <Image
            src={artwork.art}
            alt={`Photo by ${artwork.artist}`}
            className='aspect-3/4 object-cover grayscale'
            width={300}
            height={400}
          />
        </div>
        <figcaption className='pt-2 text-xs text-muted-foreground'>
          Photo by{' '}
          <span className='font-semibold text-foreground'>
            {artwork.artist}
          </span>
        </figcaption>
      </figure>
    ))}
  </div>
</ScrollAreaPro>

Examples


Horizontal

Loading...

API Reference

ScrollArea Pro

Premium ScrollArea with dynamic scrollbars, smooth progress indicators, and cross-axis flow.

Props

PropertyTypeDefaultDescription
classNamestringundefined
Additional classes to style the ScrollAreaPro or ScrollBarPro container.
childrenReactNoderequired
Content inside the ScrollAreaPro viewport.
crossDirectionalScrollbooleanfalse
Allows horizontal scroll via vertical gestures (wheel/touch) on desktop devices.
autoHidebooleanfalse
Hides the scrollbars when not actively scrolling.
showProgress"horizontal" | "vertical"undefined
Shows a progress indicator. Horizontal at the bottom, vertical along the right.
onScrollChange(progress: { x: number; y: number }) => voidundefined
Callback fired when the scroll position changes. Returns scroll progress in X and Y axes.
orientation"vertical" | "horizontal""vertical"
Orientation of the ScrollBarPro (vertical or horizontal).
showbooleantrue
Controls whether the ScrollBarPro is visible.
isScrollingbooleanfalse
Indicates if the user is actively scrolling (used for animations).

Built withby Ahdeetai.