Fluid silk
Pro effect
Most Shavin FX effects are free. This one is part of Shavin FX Pro, in early access. Join the Pro waitlist and we will email you once when access opens. You can preview it here in the meantime.
Join the FX Pro waitlistPlayground
Move cursor over canvas to interact
Variant
Pointer warp
Install
npm install @shavin/fximport { FluidSilk } from "@shavin/fx";Works with
React
Client component; Next.js and any React 18+ app
Remotion
Frame-exact through FxTimeProvider or time
Anatomy
import { FluidSilk } from "@shavin/fx";
// Theme palette: built from the brand colour, follows light and dark
<div className="relative w-full h-80 rounded-[var(--radius-panel)] overflow-hidden">
<FluidSilk
speed={0.4}
distortion={0.65}
grain={0.04}
interactive={true}
className="w-full h-full"
/>
</div>
// Custom palette: the first four colours are used
<FluidSilk
colors={["#2563eb", "#1d4ed8", "#3b82f6", "#0f172a"]}
speed={0.35}
distortion={0.7}
/>Examples
Theme palette
With no colors the folds are coloured from the brand colour and redraw when the theme switches between light and dark.
Component Source
<div className="relative w-full h-64 rounded-[var(--radius-panel)] overflow-hidden border border-hairline">
<FluidSilk
speed={0.35}
distortion={0.7}
grain={0.04}
interactive={true}
className="w-full h-full"
/>
</div>Custom palette
Three blues and a near-black slate passed as an array. The effect reads the first four colours.
Component Source
<div className="relative w-full h-64 rounded-[var(--radius-panel)] overflow-hidden border border-hairline">
<FluidSilk
colors={["#2563eb", "#1d4ed8", "#3b82f6", "#0f172a"]}
speed={0.3}
distortion={0.6}
grain={0.04}
interactive={true}
className="w-full h-full"
/>
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| colors | FxPalette: "theme" | "native" | "brand-dark" | "brand-light" | string[] | { light: string[]; dark: string[] } | "theme" | Palette. "theme" derives the gradient from the brand colour and follows light/dark ("native" is the same look); "brand-dark" / "brand-light" force one side; an array of colours (or { light, dark } arrays) is custom; the first 4 are used. |
| speed | number | 0.4 | Animation speed multiplier. |
| distortion | number | 0.65 | How far the noise bends the folds, roughly 0 to 1. |
| grain | number | 0.04 | Film grain over the silk, 0 to 0.2. |
| interactive | boolean | true | The silk warps around the pointer (mouse, touch and pen). Ignored under reduced motion and when time is set. |
| time | number | — | Controlled time in seconds (e.g. frame / fps in Remotion): draws exactly this moment and runs no clock of its own. Also read from FxTimeProvider. |