Modus UI

Godray Haze

Web (React)

Volumetric light rays through a hazy gradient sky.

Volumetric god rays streaming from the top corner over a sky gradient, with soft fractal haze and a vignette. 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.

Godray Haze

Installation

CLI

npx @modus-ui/cli add godray-haze

Manual

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

Usage

tsx
import { GodrayHaze } from "@/components/ui/godray-haze";

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

Props

PropTypeDefaultDescription
rayColorstring"#fde68a"Colour of the light rays.
skyColorstring"#1e293b"Top colour of the sky gradient.
groundColorstring"#020617"Bottom colour and vignette tint.
speednumber0.5Ray animation speed.
intensitynumber0.6Brightness of the rays.
densitynumber0.3Density of the rays.
spottynumber1How broken up the rays are.

Comments

  • No comments yet.