Docs / Components / Dot Trail Background

Dot Trail Background

A dark background component where moving the cursor reveals a dynamic, smooth-decaying grid of glowing dots along the mouse path.

Dot Trail Background

Move your cursor anywhere across the frame to reveal the dynamic glowing dot trail.

Dependencies

Install the following dependencies to use this component:

1npm install clsx tailwind-merge

Installation

Run the following command in your terminal to add the component to your project:

1npx rankflow-ui@latest add dot-trail-background

Props Reference

PropTypeDefaultDescription
bgColorstring'#000000'Base background color of the container.
dotColorstring'#ffffff'Color of the revealed dots.
gapnumber22Spacing between grid dots in pixels.
baseDotSizenumber0Base radius of dots when idle (0 = invisible background).
maxDotSizenumber6Maximum radius of dots when revealed by cursor.
strokeWidthnumber55Radius of the cursor brush stroke.
fadeDurationnumber400Duration in ms before revealed dots fade out.
glowbooleantrueWhether to enable soft radial glow around revealed dots.
glowColorstring'rgba(255, 255, 255, 0.45)'Color of the dot glow effect.
classNamestring''Additional CSS classes.