Modus UI

Fluted Gradient

Web (React)

A flowing silk gradient seen through ribbed fluted glass.

A four-colour flowing gradient refracted through vertical fluted glass bars, with fine grain. 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.

Fluted Glass

Installation

CLI

npx @modus-ui/cli add fluted-gradient

Manual

  1. Install shaders with npm install shaders.
  2. Copy the code from the component tab.
  3. Create a file at components/ui/fluted-gradient.tsx.
  4. Paste the code.

Usage

tsx
import { FlutedGradient } from "@/components/ui/fluted-gradient";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <FlutedGradient />
      <div className="relative z-10 p-8">
        <h1>Content over the effect</h1>
      </div>
    </div>
  );
}

Props

PropTypeDefaultDescription
colorAstring"#0b1026"First gradient colour.
colorBstring"#ff6b3d"Second gradient colour.
colorCstring"#7c3aed"Third gradient colour.
colorDstring"#22d3ee"Fourth gradient colour.
speednumber0.6Gradient flow speed.
distortionnumber0.8Gradient band distortion.
frequencynumber10Number of glass flutes.
anglenumber0Angle of the flutes in degrees.
refractionnumber1.5Refraction strength.
aberrationnumber0.2Chromatic aberration at the flute edges.

Comments

  • No comments yet.