Skip to content

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 waitlist

Playground

Move cursor over canvas to interact

Variant

Pointer warp

Install

npm install @shavin/fx
import { 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

PropTypeDefaultDescription
colorsFxPalette: "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.
speednumber0.4Animation speed multiplier.
distortionnumber0.65How far the noise bends the folds, roughly 0 to 1.
grainnumber0.04Film grain over the silk, 0 to 0.2.
interactivebooleantrueThe silk warps around the pointer (mouse, touch and pen). Ignored under reduced motion and when time is set.
timenumber—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.
Configure Theme
Theme
Brand Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font