Silk Shader
Flowing silk from a single WebGL fragment shader, with sheen highlights, film grain and gentle pointer drift.
Overview
Layered sine domain-warping folds the plane into soft creases of fabric, and a narrow sheen band rolls across the folds like light on satin. A touch of film grain stops gradient banding on large screens. The surface leans subtly toward the pointer with heavy damping, so it feels like air moving the cloth.
It is built to be a good citizen. It draws one full-screen triangle with no textures and no dependencies, caps pixel ratio at 1.5, pauses offscreen and in background tabs, and is safe under React StrictMode remounts. Without WebGL, or with reduced motion, it renders a matching radial gradient or a single still frame.
Use it for luxurious hero sections, launch pages and event sites. Pick three colours from deep to highlight.
When to use
- Hero areas and empty states that need atmosphere behind real content.
When not to use
- Behind long-form text, where motion competes with reading.
Installation
pnpm dlx shadcn@latest add https://sundaeui.dev/r/silk-shader.jsonnpx shadcn@latest add https://sundaeui.dev/r/silk-shader.jsonyarn dlx shadcn@latest add https://sundaeui.dev/r/silk-shader.jsonbunx --bun shadcn@latest add https://sundaeui.dev/r/silk-shader.jsonWorks in any React project. Files are written to components/sundae/. Read the source in the stage’s Code view. Pro assets need a personal token. See authenticated installs.
- No dependencies beyond React 18 or later.
- Copy silk-shader.tsx into components/sundae/.
- The CSS file is imported by the component, so no extra configuration is needed.
- Import the component and use it as shown below.
Usage
import { SilkShader } from '@/components/sundae/silk-shader'
<SilkShader className="min-h-[80vh]" colors={['#0b1020', '#2a3f8f', '#c9d6ff']} speed={0.8}>
<Hero />
</SilkShader>Props
| Prop | Type | Default |
|---|---|---|
colorsHex colours. | [deep, mid, highlight] | ['#140d0b', '#7a2e1d', '#f2b27a'] |
speedFlow speed. | number | 1 |
scaleFold frequency. | number | 2.2 |
grainFilm grain, from 0 to 1. | number | 0.6 |
childrenContent above the surface. | ReactNode | — |
Accessibility
- The canvas is aria-hidden. Check text contrast against the highlight colour.
- Reduced motion renders a single still frame.
Customization
- For a lighter look, try colors={["#e8e2d6", "#c9b89c", "#ffffff"]} with dark text.
FAQ
- Is Silk Shader free?
- Silk Shader is part of Sundae Pro. The live preview is open to everyone; the source installs with a Pro account.
- How do I install Silk Shader?
- Run npx shadcn@latest add https://sundaeui.dev/r/silk-shader.json. The files are written to components/sundae/. It has no dependencies beyond React 18 or later.
- Does Silk Shader support keyboard and screen readers?
- The canvas is aria-hidden. Check text contrast against the highlight colour. Reduced motion renders a single still frame.
- Does Silk Shader respect reduced motion?
- Reduced motion renders a single still frame.
More like this
All backgrounds →Ink Field
Backgrounds · Organic- Pro
Contour Field
Backgrounds · Editorial - Pro
Dot Grid
Backgrounds · Understated - Pro
Word Morph
Motion · Expressive - Pro
Billboard Hero
Sections · Brutalist Taffy Tabs
Navigation · Playful