UI.MD

Scroll Fade

A scrollable container with gradient fade edges to indicate overflow.

Installation

$
npx shadcn@latest add https://ui.mattdowney.com/r/scroll-fade.json

Usage

import { ScrollFade } from "@/components/ui/scroll-fade"

Examples

Default

Scrollable item 1

Scrollable item 2

Scrollable item 3

Scrollable item 4

Scrollable item 5

Scrollable item 6

Scrollable item 7

Scrollable item 8

Scrollable item 9

Scrollable item 10

Scrollable item 11

Scrollable item 12

API Reference

PropTypeDefaultDescription
skimHeightnumber24Height of the gradient fade skim at each edge, in pixels. The fade ramps in with scroll distance, solid at a fully scrolled edge; nothing is reserved at rest.
fade"both" | "top" | "bottom""both"Which edges show the fade skim. Use bottom when the container has a frozen header (Table stickyHeader): a top skim would fade the sticky header as rows scroll under it.