AI SDK Agents
Full Stack AI Patterns
Complex AI Agents
Workflow Patterns
Tools + Artifacts
pnpm dlx shadcn@latest add https://cult-ui.com/r/shader-lens-blur.json
import ShaderLensBlur from "@/components/ui/shader-lens-blur"Render the default interactive lens blur canvas:
<div className="w-full max-w-2xl">
<ShaderLensBlur />
</div>ShaderLensBlur reads its configuration from the exported configAtom. This makes it easy to drive from your own controls, presets, or app state.
"use client"
import { useAtom } from "jotai"
import ShaderLensBlur, { configAtom } from "@/components/ui/shader-lens-blur"
export function ShaderLensBlurControlled() {
const [config, setConfig] = useAtom(configAtom)
return (
<div className="space-y-4">
<ShaderLensBlur />
<button
className="rounded-md border px-3 py-2 text-sm"
onClick={() =>
setConfig((prev) => ({
...prev,
variation: (prev.variation + 1) % 4,
invertMouse: !prev.invertMouse,
}))
}
>
Toggle Preset
</button>
<p className="text-sm text-muted-foreground">
Current variation: {config.variation}
</p>
</div>
)
}The component supports custom canvas dimensions through the same atom config:
setConfig((prev) => ({
...prev,
width: "100%",
height: "520px",
}))| Export | Type | Description |
|---|---|---|
ShaderLensBlur | React.ComponentType | Main interactive shader component |
configAtom | Atom<ShaderConfig> | Shared state for colors, variation, interaction mode, and dimensions |
ShaderConfig Shape| Key | Type | Default | Description |
|---|---|---|---|
variation | number | 3 | Shape mode (0 square-ish frame, 1 solid circle, 2 ring, 3 triangle) |
color1 | string | #D5F981 | Gradient color stop 1 |
color2 | string | #A1BBE7 | Gradient color stop 2 |
color3 | string | #F2BAE2 | Gradient color stop 3 |
color4 | string | #68E8FA | Gradient color stop 4 |
enableHover | boolean | true | Enables pointer tracking without requiring press/drag |
invertMouse | boolean | true | Inverts the pointer influence mask |
width | string | "100%" | Container width style |
height | string | "400px" | Container height style |
THREE.WebGLRenderer with an orthographic full-screen quad and custom fragment shader.configAtom changes.next-themes) and influences subtle color mixing behavior in the shader.280px for comfortable pointer/touch interaction.enableHover: false so effects primarily respond during active touch/press.scale(...)) on the canvas container.getBoundingClientRect).ThemeProvider from next-themes.Inspiration