Hero: shader
Hero on a soft gradient in your primary color.
Preview
The gradient flows, painted with plain WebGL (no 3D library). It only draws while on screen, stops for reduced motion, has a Pause background button, and falls back to the CSS gradient where WebGL isn't available. With reduced motion turned on, it renders the plain layout.
Beta
A hero that moves like light on water
A WebGL gradient in your primary color. Sample copy.
Beta
A hero that moves like light on water
A WebGL gradient in your primary color. Sample copy.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { HeroShader } from "@/components/custom/hero-shader";
<HeroShader
eyebrow="Beta"
title="A hero that moves like light on water"
primaryAction={{ label: "Get started", href: "/signup" }}
/>import { HeroShaderMotion } from "@/components/custom/hero-shader/hero-shader-motion";
<HeroShaderMotion title="A hero that moves like light on water" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | The headline, rendered as the page's h1. |
| eyebrow | string | – | Small badge above the title. |
| description | string | – | Supporting line under the title. |
| primaryAction | { label: string; href: string } | – | Filled button. |
| secondaryAction | { label: string; href: string } | – | Outline button. |
| ...props | React.ComponentProps<"section"> | – | Any other section attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The gradient and canvas are decorative and hidden from screen readers.
- Text sits on a light tint of your primary color, so check contrast if your primary is very light.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.