On this page
Invite reviewers once the spec is stable.
Confirm keyboard access for every overflow region.
Measure content changes after async data lands.
Keep the browser scrollbar visible for platform familiarity.
Prefer masks over static overlays when the surface color can vary.
Use edge-aware CSS variables so the fade disappears at the limits.
Resize observers keep the affordance in sync with dynamic content.
Mutation observers catch late-rendered rows and changing copy.
RTL horizontal scrolling needs normalized start and end distances.
Programmatic scroll should update the fade without implying user input.
Native scroll momentum should keep the scrolling state briefly alive.
The mask should be zero-cost when the content does not overflow.
const updates = /* ... */;
<ScrollFade className="h-56 w-full max-w-md rounded-lg border bg-bg p-4">
<div className="space-y-3">
{updates.map((update) => (
<div key={update} className="rounded-md bg-muted px-3 py-2 text-sm">
{update}
</div>
))}
</div>
</ScrollFade>Installation
npm
pnpm
yarn
bun
npx shadcn@latest add @dotui/scroll-fadeUsage
import { ScrollFade } from '@/components/ui/scroll-fade'<ScrollFade className="h-64">
<div>Scrollable content</div>
</ScrollFade>Examples
Invite reviewers once the spec is stable.
Confirm keyboard access for every overflow region.
Measure content changes after async data lands.
Keep the browser scrollbar visible for platform familiarity.
Prefer masks over static overlays when the surface color can vary.
Use edge-aware CSS variables so the fade disappears at the limits.
Resize observers keep the affordance in sync with dynamic content.
Mutation observers catch late-rendered rows and changing copy.
RTL horizontal scrolling needs normalized start and end distances.
Programmatic scroll should update the fade without implying user input.
Native scroll momentum should keep the scrolling state briefly alive.
The mask should be zero-cost when the content does not overflow.
OverviewAccessibilityStylingCompositionAnimationValidationInternationalizationPerformanceTestingRelease notesMigrationChangelog
R1 C1
R1 C2
R1 C3
R1 C4
R1 C5
R1 C6
R1 C7
R1 C8
R2 C1
R2 C2
R2 C3
R2 C4
R2 C5
R2 C6
R2 C7
R2 C8
R3 C1
R3 C2
R3 C3
R3 C4
R3 C5
R3 C6
R3 C7
R3 C8
R4 C1
R4 C2
R4 C3
R4 C4
R4 C5
R4 C6
R4 C7
R4 C8
R5 C1
R5 C2
R5 C3
R5 C4
R5 C5
R5 C6
R5 C7
R5 C8
R6 C1
R6 C2
R6 C3
R6 C4
R6 C5
R6 C6
R6 C7
R6 C8
R7 C1
R7 C2
R7 C3
R7 C4
R7 C5
R7 C6
R7 C7
R7 C8
R8 C1
R8 C2
R8 C3
R8 C4
R8 C5
R8 C6
R8 C7
R8 C8
R9 C1
R9 C2
R9 C3
R9 C4
R9 C5
R9 C6
R9 C7
R9 C8
R10 C1
R10 C2
R10 C3
R10 C4
R10 C5
R10 C6
R10 C7
R10 C8
R11 C1
R11 C2
R11 C3
R11 C4
R11 C5
R11 C6
R11 C7
R11 C8
R12 C1
R12 C2
R12 C3
R12 C4
R12 C5
R12 C6
R12 C7
R12 C8
API Reference
A native scroll container with edge-aware gradient fade affordances.
Supports all div attributes.
| Prop | Type | Default | |
|---|---|---|---|
Last updated on 6/27/2026