Shader background
A GPU-drawn animated background.
When to use
- Hero areas with a living backdrop.
When not to use
- Text needs strong contrast.
- Low-power devices.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/shader-background
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
ShaderBackground
7 props
PropTypeDefaultDescription
colorsreadonly [string, string, string, string]["var(--chart-1)", "var(--chart-3)", "var(--chart-2)", "var(--chart-5)"]Four CSS colors blended by the shader. Theme variables work.
intensitynumber0.50 shows the page background, 1 shows the full color field. Keep text legible.
speednumber1
scalenumber1.6Size of the pattern; larger is finer.
childrenReactNode—
classNamestring—
contentClassNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements, so roles and focus come from the browser.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/shader-background.mdThe index of every part is at /llms.txt.