Make your AI a shadcn expert

Shadcn Scroll Fade

React scroll fade for overflowing lists and carousels. Built with TypeScript and Tailwind CSS for Next.js using Base UI — mask edges that track the scroll.

A scroll fade dissolves the content at the edge of a scroller. Put scroll-fade on the element with overflow-y-auto. No overlay color — the mask is the content itself.

Scroll to load preview...

Usage

<div className="scroll-fade overflow-y-auto">{/* … */}</div>

scroll-fade or scroll-fade-y for vertical. scroll-fade-x for a horizontal strip.

Composition

scroll-fade
scroll-fade-x
scroll-fade-none

These are CSS utilities from the shadcn package. No component file.

No Overflow, No Fade

If the list fits, the fade stays off. You can leave the class on every list.

Scroll to load preview...

Horizontal Scrolling

scroll-fade-x on overflow-x-auto. In RTL the crisp edge follows the start.

Scroll to load preview...

Edge Fades

One edge only: scroll-fade-b, scroll-fade-t, or scroll-fade-s / scroll-fade-e for logical inline.

Scroll to load preview...

Fade Size

scroll-fade-24 sets a fixed depth. Default is 12% of the box, capped at 40px.

Scroll to load preview...

Disabling the Fade

scroll-fade-none wins in any class order. Use it at a breakpoint.

Scroll to load preview...

RTL

scroll-fade-x follows reading direction. At rest the start edge is crisp.

Scroll to load preview...

API

ClassWhat it does
scroll-fadeVertical fade, scroll-aware
scroll-fade-xHorizontal fade, RTL-aware
scroll-fade-t / b / s / eOne edge
scroll-fade-<n>Fixed size on the spacing scale
scroll-fade-noneTurn it off

Notes

Put the class on the scroller

The element with overflow-auto gets the mask. A card wrapper keeps its border; the fade lives on the inner list.

Pair with no-scrollbar if a visible bar should not fade with the content.

With other components

Questions

Was this page helpful?

Sign in to leave feedback.