Animated Gradient
BackgroundsMITSlow-drifting animated gradient mesh for ambient hero backgrounds.
bun add @otfdashkit/ui
Preview
Animated GradientBackgrounds
Loading Storybook preview…
Code
@otfdashkit/uiimport { AnimatedGradient } from '@otfdashkit/ui'
export function Example() {
return (
<div className="space-y-0">
{(['mesh', 'shift', 'pulse'] as const).map((variant) => (
<div key={variant} className="relative h-[250px]">
<AnimatedGradient variant={variant} />
<div className="relative z-10 flex items-center justify-center h-full">
<span className="text-white/80 text-lg font-semibold capitalize">{variant}</span>
</div>
</div>
))}
</div>
)
}
Free with the SDK. This pattern ships in @otfdashkit/ui under the MIT license.
Props
Props declared in the AnimatedGradient source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| blur | boolean | true | Whether to blur the gradient blobs (mesh only) |
| colors | string[] | Gradient color stops — at least 2 required | |
| speed | number | 1 | Speed multiplier (default 1) |
| variant | 'mesh' | 'shift' | 'pulse' | 'mesh' | Animation style |