Gradient Background
BackgroundsMITStatic gradient backgrounds in multiple presets — for hero sections and banners.
bun add @otfdashkit/ui
Preview
Gradient BackgroundBackgrounds
Loading Storybook preview…
Code
@otfdashkit/uiimport { GradientBackground } from '@otfdashkit/ui'
export function Example() {
return (
<div className="grid grid-cols-2 gap-0 h-screen">
{(['slate', 'warm', 'cosmic', 'terminal'] as const).map((preset) => (
<div key={preset} className="relative h-full min-h-[300px]">
<GradientBackground preset={preset} />
<div className="relative z-10 flex items-center justify-center h-full">
<span className="text-white/90 text-lg font-semibold capitalize">{preset}</span>
</div>
</div>
))}
</div>
)
}
Free with the SDK. This pattern ships in @otfdashkit/ui under the MIT license.
Kit for this component
Landing templates$9 each
Add a gradient background behind a page or hero section.
Props
Props declared in the GradientBackground source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| fixed | boolean | false | Full-screen fixed backdrop |
| gradient | string | Custom gradient CSS string e.g. "radial-gradient(...)" — only when preset='custom' | |
| noise | boolean | false | Additional noise/texture overlay (subtle grain) |
| preset | 'slate' | 'warm' | 'cosmic' | 'terminal' | 'aurora' | 'custom' | 'subtle' | 'slate' | |
| radial | boolean | false | Radial spot blend on top |