Toggle Sidebar B
AppearanceLight & dark mode D

Text Pressure

Characters scale / warp interactively based on pointer pressure zone.

Default

Move the pointer across the word. Every prop is wired to the controls underneath.

Dark previewReplay previewOpen in new tab

Hello!

Customize

Text Color
Stroke Color

API Reference

TextPressure

PropTypeDefaultDescription
textstring"Compressa"Text content that will be displayed and animated.
fontFamilystring"Roboto Flex"Name of the variable font family.
fontUrlstringGoogle Fonts Roboto Flex URLURL for the variable font stylesheet (needed). The component adds it to the document head once.
flexbooleantrueWhether the characters are spaced using flex layout.
scalebooleanfalseIf true, vertically scales the text to fill its container height.
alphabooleanfalseIf true, applies an opacity effect based on cursor distance.
strokebooleanfalseIf true, adds a stroke effect around characters.
widthbooleantrueIf true, varies the variable-font "width" axis.
weightbooleantrueIf true, varies the variable-font "weight" axis.
italicbooleantrueIf true, varies the variable-font "italics" axis.
textColorstring"#FFFFFF"The fill color of the text.
strokeColorstring"#FF0000"The stroke color that will be applied to the text when "stroke" is set to true.
classNamestring""Additional class for styling the <h1> wrapper.
minFontSizenumber24Sets a minimum font-size to avoid overly tiny text on smaller screens.

Accessibility

Keyboard shortcuts and ARIA behavior.

  • The effect follows the pointer only. Touch drags update it too, but keyboard users see the resting state.
  • Each character sits in its own span, so some screen readers spell the word out. Add an aria-label with the full text if that matters.