Text Animations

Variable Proximity

Text whose letters interpolate font weight by cursor proximity.

Adapted from React Bits

Install

bun add motion

Then copy 2 files into your project:

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

Props

PropTypeDefaultDescription
radiusnumber80Cursor influence radius.
falloff"linear" | "exponential" | "gaussian""linear"How influence falls off with distance.

What It Demonstrates

Hover effect
Visual change when the cursor moves over an element.
Interpolation / Tween
Generating all the in-between frames between a start and end value, so motion is continuous.

Related Components

Appears In