Section Fade
A section whose live gradient fades out at its edges.
Between two sections
import { SectionFade } from "@/components/section-fade";
export function SectionFadeDemo() {
return (
<SectionFade edges="both" className="grid h-[360px] place-items-center">
<h2 className="text-3xl font-semibold tracking-tight">
Between two sections
</h2>
</SectionFade>
);
}
Installation
pnpm dlx shadcn@latest add https://gradients.sh/r/section-fade.jsonUsage
import { SectionFade } from "@/components/section-fade";
<SectionFade edges="bottom" className="py-32">
{children}
</SectionFade>;Props
| Prop | Type | Default |
|---|---|---|
childrenSection content. | ReactNode | — |
kindWhich gradient fills the component: one of the six free kinds, or any kind registered with the engine. | GradientKind | "aurora" |
edgesWhich edges fade to transparent. | "top" | "bottom" | "both" | "both" |
colorsTwo to six colours: hex, oklch(), names or var(--token). | [string, string, ...string[]] | ["#a0f0c8", "#3fb5a3", "#5147b6", "#b25c9c"] |
backgroundBase colour under the gradient. | string | "#03050b" |
speed0 to 2. How fast the gradient moves. 0 holds it still. | number | 0.7 |
loopSeconds4 to 30. The animation repeats exactly every loopSeconds. | number | 18 |
scale0.25 to 4. Noise frequency: higher means smaller shapes. | number | 1 |
warp0 to 1. Domain-warp strength. | number | 0.5 |
grain0 to 1. Film grain. | number | 0.1 |
blur0 to 1. Softness. | number | 0.5 |
seedInteger seed for the noise field. | number | 3 |
ditherOrdered 4×4 Bayer dither. | { enabled?: boolean; cell?: number; levels?: number } | { enabled: false, cell: 3, levels: 8 } |
interaction0 to 1 influence of the pointer and of scroll velocity. | { pointer?: number; scroll?: number } | { pointer: 0.2, scroll: 0.2 } |
maxDprDevice pixel ratio cap for the canvas. | number | 1.5 |
reducedMotion"respect" shows one still frame when the user prefers reduced motion. | "respect" | "ignore" | "respect" |
classNameClasses for the outer element. Size it here; the gradient fills it. | string | — |