Backgrounds

Side Rays

Corner-anchored two-color light rays with adjustable tilt and blend.

Adapted from React Bits

Install

bun add ogl

Then copy 2 files into your project:

  • components/registry/side-rays/side-rays.tsx
  • hooks/use-animation-loop.ts

Props

PropTypeDefaultDescription
speednumber1Animation speed.
rayColor1string (hex)"#a855f7"First ray color.
rayColor2string (hex)"#22d3ee"Second ray color.
intensitynumber2Ray brightness.
spreadnumber1Angular spread.
tiltnumber0Tilt of the ray bundle.
saturationnumber1Color saturation.
blendnumber0.5Blend between the two colors.
falloffnumber1Edge falloff.
opacitynumber0.9Overall opacity.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.

Related Components

Appears In