Backgrounds

Ribbons

Flowing translucent ribbons drifting across a canvas.

Adapted from React Bits

Install

# Ribbons needs no npm packages

Then copy 2 files into your project:

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

Props

PropTypeDefaultDescription
colorstring (hex)"#0037ff"Ribbon color.
colorAlphanumber0.7Ribbon opacity.
ribbonCountnumber4Number of ribbons on screen.
strokeSizenumber1Outline thickness.
horizontalSpeednumber200Drift speed across the canvas.
parallaxAmountnumber-0.2Scroll parallax factor.
verticalPosition"top" | "middle" | "bottom" | "random""random"Where ribbons spawn vertically.
animateSectionsbooleanfalseWiggle ribbon segments over time.

What It Demonstrates

Loop
An animation that repeats, a set number of times or infinitely.
Float
A gentle, continuous up-and-down drift that makes a static element feel alive and weightless.
Idle animation
Subtle motion that plays while an element is just sitting there, waiting to be interacted with.

Related Components

Appears In