Toggle Sidebar B
AppearanceLight & dark mode D

Variable Proximity

Letter styling changes continuously with pointer distance mapping.

Default

Move the pointer over the text. Every prop is wired to the controls underneath. The component loads Roboto Flex from Google Fonts, a variable font with weight and optical size axes.

Light previewReplay previewOpen in new tab
          Hover me! And then star the repo on GitHub, or else...

Customize

Radius100px
Falloff

API Reference

VariableProximity

PropTypeDefaultDescription
labelstring""The text content to display.
fromFontVariationSettingsstring'wght' 400, 'opsz' 9The starting variation settings.
toFontVariationSettingsstring'wght' 800, 'opsz' 40The variation settings to reach at cursor proximity.
containerRefHTMLElement | Ref<HTMLElement>undefinedReference to container for relative calculations.
radiusnumber50Proximity radius to influence the effect.
falloff'linear' | 'exponential' | 'gaussian'"linear"Type of falloff for the effect.

Accessibility

Keyboard shortcuts and ARIA behavior.

  • Letters are aria-hidden and the full label is repeated in a visually hidden span, so screen readers read it once.
  • The effect follows the pointer only, so touch and keyboard users see the base weight (touch drag is tracked).