uibrik

Caustics

Preview

Customize

Colors
Strength0.60
Waves0.35
Depth1.40
Scale1.00
Dispersion0.50
Chop0.55
Direction23°
Softness0.05
Bloom1.10
Sparkle1.25
Sparkle size1.00
Ray angle70°
Vignette0.25
Shade0.80
Speed1.0
Grain0.015
Seed0
Follow0.75
Touch0.50
Ripple strength0.35
Ripple size1.00
Ripple speed1.00

Usage

import { Caustics } from "@/components/uibrik/caustics/caustics";

<Caustics />

Installation

npx shadcn@latest add https://uibrik.com/r/caustics.json
Adds the files to components/uibrik/caustics. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/caustics.

Props

Caustics
colors
Type string[]
["#0b3a53","#0f6f8f","#3fb6c9","#e6fbff"]
Pool floor from deep to shallow, then the light's tint last; 2 to 6 colours.
strength
Type number
0.6
How strong the light is against the plain floor.
waves
Type number
0.35
Wave height.
depth
Type number
1.4
Floor depth: deeper water focuses the light into thinner, brighter lines.
scale
Type number
1
Size of the waves; larger is calmer.
dispersion
Type number
0.5
Colour fringing at the edges of the light.
chop
Type number
0.55
Irregular chop on top of the wave trains; 0 leaves only smooth swells.
direction
Type number
23
Direction the main waves travel.
softness
Type number
0.05
Blur on the light, like a larger sun.
bloom
Type number
1.1
Glow spilling around the brightest light.
sparkle
Type number
1.25
Star-shaped sun glints where the light peaks.
sparkleSize
Type number
1
Length of the glint rays.
rayAngle
Type number
70
Direction of the long glint rays.
vignette
Type number
0.25
Darkening toward the corners.
shade
Type number
0.8
How much the floor colour varies.
speed
Type number
1
Animation speed; 1 is the designed pace.
grain
Type number
0.015
Film grain strength.
seed
Type number
0
Shifts the composition, so two backgrounds with the same settings still differ.
animate
Type boolean
true
Move on its own. Off draws one still frame.
interactive
Type boolean
true
React to the pointer.
follow
Type number
0.75
How lazily the fingertip dip follows the pointer, 0 (locked) to 1 (drifts after it).
touch
Type number
0.5
How deep the pointer dips into the water.
ripples
Type boolean
true
A click drops a ripple on the water.
rippleStrength
Type number
0.35
Height of a click ripple.
rippleSize
Type number
1
Wavelength of a click ripple; larger is broader.
rippleSpeed
Type number
1
How fast a ripple spreads.
children
Type ReactNode
–
Content shown on top of the background.
className
Type string
–
Classes for the box; it fills whatever size you give it.