Silk Mesh
Web (React)
A soft flowing mesh gradient in your theme colours with grain and noise texture.
A drifting mesh gradient whose colours default to your theme's background and primary tokens, textured with soft-light noise and film grain. Colours update when the theme changes. It fills its positioned parent and freezes its animation when the user prefers reduced motion. Built on the shaders library (MIT) and rendered with WebGPU.
Silk Mesh
Installation
CLI
npx @modus-ui/cli add silk-meshManual
- Install
shaderswithnpm install shaders. - Copy the code from the component tab.
- Create a file at
components/ui/silk-mesh.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
colorA | string | theme token | First colour. Defaults to the --background token. |
colorB | string | theme token | Second colour. Defaults to the --primary token. |
speed | number | 0.6 | Drift speed. |
count | number | 4 | Number of colour swaths. |
swirl | number | 0.5 | Amount of swirl in the swaths. |
smoothness | number | 0.6 | Softness of the seams between swaths. |
grain | number | 0.06 | Film grain strength. |
Comments