Glow Bars Background

An ambient background of softly glowing bars that breathe on idle, rise toward the cursor on hover, and send a ripple of light across on click. Wrap your content in it or drop it behind any section with asBackground. GPU-driven motion with zero React re-renders while animating.

Ambient background

Glowing bars that answer back.

Move your cursor and the bars lean toward it. Click anywhere and a ripple of light travels across. Everything breathes on its own — all on the GPU, with zero re-renders.

Hover to liftClick for ripplesGPU animated

Installation

  1. 1

    Install the component:

    npx shadcn@latest add https://ui.amines.fun/registry/glow-bars-background.json
  2. 2

    Usage:

    jsx

    app/page.jsx

    <GlowBarsBackground className="flex min-h-screen flex-col justify-center">  <h1 className="text-4xl font-bold">Your content</h1></GlowBarsBackground>

Props

PropTypeDefaultDescriptionRequired
childrenReactNode-Content rendered inside the wrapper, above the bars. Omit it and use asBackground to place the effect behind existing content.No
classNamestring""Tailwind classes for the wrapper — height, layout, and surface color, e.g. "min-h-screen" or "h-[640px] bg-white".No
styleReact.CSSPropertiesundefinedInline styles applied to the wrapper.No
asBackgroundbooleanfalseWhen true the component becomes an absolute, pointer-events-none layer that fills its parent (which needs relative isolate) and reads hover/click from the parent instead of itself.No
colorsstring[]["#1f6bff", "#3a8dff", "#58a9ff", "#2a7bff"]Bar colors as any CSS color strings. Each bar picks one from the list.No
barCountnumber28Number of bars, clamped between 1 and 120. Lower counts are cheaper on low-end devices.No
shape"random" | "mountain" | "valley" | "wave" | "flat""random"Height profile of the bars: random scatter, peak in the middle, dip in the middle, sine wave, or near-uniform tall bars.No
seednumber7Seed for the deterministic bar layout. The same seed always produces the same arrangement (no hydration mismatch); change it for a different stable look.No
heightRange[number, number][0.35, 0.9]Min and max bar height as a fraction of the container height.No
opacityRange[number, number][0.55, 1]Min and max bar opacity.No
gapnumber6Space between bars in pixels.No
blurnumber12Softness of the bars in pixels. 0 renders sharp bars and is the cheapest option.No
glowbooleantrueShow a soft radial light along the bottom edge of the container.No
glowColorstring"#5ab8ff"CSS color of the bottom glow.No
glowOpacitynumber0.55Opacity of the bottom glow, 0 to 1.No
glowHeightnumber0.35Height of the bottom glow as a fraction of the container height.No
idlebooleantrueBars gently breathe on their own, staggered into a slow wave. Runs on the GPU via WAAPI and pauses off-screen.No
idleDurationnumber4.5Seconds for one breath cycle.No
idleAmountnumber0.25How much bars shrink at the bottom of each breath, clamped 0 to 0.9.No
idleStaggernumber0.25Seconds of offset between neighbouring bars, which creates the travelling wave.No
hoverbooleantrueMaster switch for every hover effect (bar lift and cursor glow).No
hoverRadiusnumber0.2How wide the hover effect is, as a fraction of the container width.No
hoverLiftnumber0.45How much bars grow near the cursor. Negative values shrink them instead.No
cursorGlowbooleantrueShow a soft radial light that follows the cursor. Requires hover to be enabled.No
cursorGlowColorstring"#7cc7ff"CSS color of the cursor glow.No
cursorGlowSizenumber380Diameter of the cursor glow in pixels.No
cursorGlowOpacitynumber0.4Peak opacity of the cursor glow.No
stiffnessnumber170Spring stiffness for hover motion. Higher is snappier.No
dampingnumber22Spring damping for hover motion. Lower is bouncier.No
clickbooleantrueMaster switch for every click effect (ripple and burst).No
ripplebooleantrueOn click, a wave of lift travels outward from the click point across the bars.No
clickLiftnumber0.6Height of the click ripple as a scale multiplier.No
rippleSpeednumber0.8Seconds for the ripple delay to cross the full width; each bar also uses it to offset its wave.No
rippleDurationnumber0.9Seconds each bar takes to rise and settle during a ripple.No
burstbooleantrueFlash a soft glow at the click point.No
burstColorstring"#8fd0ff"CSS color of the click burst.No
burstSizenumber420Diameter of the click burst in pixels.No
pausedbooleanfalsePause the idle breathing animation.No
respectReducedMotionbooleantrueTurn off idle, hover, and click motion for users who prefer reduced motion.No