Rain

PreviousNext

A dynamic animated rain and lightning background component with optional thunder audio effects.

rain-default

Installation

pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/rain.json

Usage

import { Rain } from "@/components/ui/rain"
<div className="relative h-[400px] w-full rounded-lg border bg-black">
  <Rain lightningEnabled thunderEnabled className="text-blue-400">
    <div className="relative z-10 flex h-full items-center justify-center">
      <p className="text-lg font-medium text-white">
        Content over animated rain background
      </p>
    </div>
  </Rain>
</div>

API Reference

Rain

Renders animated raindrops with optional lightning and thunder effects.

PropTypeDefaultDescription
intensitynumber100Number of raindrops rendered.
speednumber1Speed multiplier for raindrop fall.
colorstring"rgba(174, 194, 224, 0.6)"Raindrop color.
anglenumber0Wind angle in degrees (rotation of rain).
dropSizeobject{min:1,max:3}Minimum and maximum raindrop size.
lightningEnabledbooleanfalseEnable lightning effects.
lightningFrequencynumber8Average frequency of lightning in seconds.
thunderEnabledbooleanfalseEnable thunder sound effects.
thunderVolumenumber0.5Thunder volume (0–1).
thunderDelaynumber2Delay between lightning and thunder in seconds.
classNamestringAdditional Tailwind/CSS classes applied to wrapper.
childrenReactNodeContent to render above the rain.