Morphiq

Components / Text Animations / Pressure Text

Pressure Text

Type that reacts to the cursor. Letters thicken and widen under the pointer while their neighbours give up the space, so the word keeps its overall width. Both axes are synthesised from a single cut, so a letter morphs rather than cross-dissolving between two weights.

Usage

import PressureText from '@/components/pressure-text'

<PressureText
  text="Interfaces that move"
  weight={200}
  bold={0.075}
  spread={0.9}
  cursorRadius={3.2}
  falloff="smooth"
/>

Installation

npx shadcn@latest add https://morphiq.prathampatel.design/r/pressure-text.json

Model

Σ wᵢ′ = Σ wᵢ

each letter swells by its falloff from the cursor, then every box is rescaled so the word keeps its width

Props

PropertyTypeDefaultDescription
textstring''Rendered per glyph, and used as the element's accessible name.
weightnumber200Resting weight of the single cut the effect thickens.
boldnumber0.075Peak stroke thickening under the cursor, in em.
spreadnumber0.9How much width a letter takes from its neighbours, 0..1-ish.
cursorRadiusnumber3.2Reach of the pointer's influence, in em — it scales with the type.
smoothingnumber0.03Per-frame approach rate. Lower is slower to settle.
falloffFalloff'linear'—