How to Create a Text Pressure Effect in Framer
Build a text pressure effect in Framer: variable font weight and width that react to the cursor, with a working code component and a free drop-in version.

A text pressure effect makes the letters in a headline react to the cursor. Letters near the pointer get heavier, wider or more slanted, and they relax back as the pointer moves on. In Framer you can build a text pressure effect with a short code component, or paste in a free component and tune it from the properties panel. This guide covers both: what the effect needs from your font, a working code component you can paste, how to tune it, and where it fits on a page.
We build Framer components and plugins at FramerHub, and Text Pressure is one of our free components. Search for "text pressure framer" today and you mostly find Marketplace listings with no explanation of how the effect works, so this guide shows the moving parts.
What a Text Pressure Effect Needs: A Variable Font
The effect depends on one font feature. You need a variable font with at least one of these axes:
- Weight (
wght): thin to heavy. This is the axis most text pressure builds use. - Width (
wdth): condensed to expanded. It gives the "squeezed" look that makes the effect feel physical. - Italic or slant (
ital/slnt): upright to slanted, for a third layer of motion.
A variable font is one file that holds a continuous range on each axis. Weight can sit at 437 or 612, not only at the named Regular or Bold cuts. A family of static files can only swap between those fixed cuts, which looks stepped and jumpy. If your typeface has no variable version, use a different effect for that headline or pick a variable display face for it.
How to check a font:
- Open the font's specimen page (Google Fonts lists axes for every variable family) or load it in a type tester.
- Look for a single "Variable" file with sliders, and note each axis range.
- Write the ranges down. A
wghtrange of 100 to 900 gives a dramatic effect. A range of 400 to 500 barely moves.
Good free picks for testing: Roboto Flex (weight and width axes, plus several more), Inter (weight), and Anybody (weight and width, built for display type). Load the font with its full axis range. If the loaded file only exposes part of the range, no amount of tuning in the component will make the effect stronger.
Text Pressure vs Other Text Hover Effects in Framer
Text pressure is one of several cursor-driven type effects. Pick it when you want the letterforms themselves to feel interactive.
| Effect | How it works | Feel |
|---|---|---|
| Text pressure | Font axis values change with cursor distance, per letter | Tactile, physical |
| Variable font hover | The whole word shifts weight on hover | Simple, clean |
| Letter scramble | Characters cycle randomly before settling | Techy, glitchy |
| Text shimmer | A light gradient sweeps across the text | Polished, quiet |
| Magnetic hover | The element moves toward the cursor | Playful |
If you only need a word to get bolder when hovered, our Variable Font Hover component is simpler. Text pressure is per letter, so the shape of the word changes as the cursor travels across it.
How the Text Pressure Effect Works
Under the hood every text pressure build does four things:
- Splits the headline into one
<span>per character. - Tracks the pointer position.
- For each letter, measures the distance from the pointer to the letter's center and turns it into a 0 to 1 "pressure" value (closer means higher).
- Maps that value onto each axis and writes it to the letter's
font-variation-settings.
The math is simple. Performance is where builds go wrong. A naive version stores every letter's weight in React state and re-renders on each mousemove event, which can fire well over 60 times a second. With 20 or more letters that causes visible stutter. The version below keeps the pointer position in a ref, updates the letters inside a requestAnimationFrame loop, and writes styles straight to the DOM, so React renders once and the loop does the rest.
Build a Text Pressure Code Component in Framer
In Framer, open the Assets panel, create a new code file, and paste this in. It works with any variable font that has a wght axis, and uses wdth too when the font has one.
import { useEffect, useRef } from "react"
import { addPropertyControls, ControlType } from "framer"
/**
* @framerSupportedLayoutWidth auto
* @framerSupportedLayoutHeight auto
*/
export default function TextPressure(props) {
const { text, fontFamily, fontSize, color, minWeight, maxWeight,
minWidth, maxWidth, useWidth, radius } = props
const containerRef = useRef(null)
const spansRef = useRef([])
const pointer = useRef({ x: -9999, y: -9999 })
const letters = Array.from(text || "PRESSURE")
useEffect(() => {
const reduceMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches
if (reduceMotion) return
const onMove = (e) => {
const p = e.touches ? e.touches[0] : e
pointer.current = { x: p.clientX, y: p.clientY }
}
const onLeave = () => {
pointer.current = { x: -9999, y: -9999 }
}
let frame
const tick = () => {
spansRef.current.forEach((span) => {
if (!span) return
const r = span.getBoundingClientRect()
const dx = pointer.current.x - (r.left + r.width / 2)
const dy = pointer.current.y - (r.top + r.height / 2)
const pressure = Math.max(0, 1 - Math.hypot(dx, dy) / radius)
const wght = minWeight + pressure * (maxWeight - minWeight)
const wdth = minWidth + pressure * (maxWidth - minWidth)
span.style.fontVariationSettings = useWidth
? `"wght" ${wght.toFixed(0)}, "wdth" ${wdth.toFixed(0)}`
: `"wght" ${wght.toFixed(0)}`
})
frame = requestAnimationFrame(tick)
}
const el = containerRef.current
window.addEventListener("mousemove", onMove)
window.addEventListener("touchmove", onMove, { passive: true })
el.addEventListener("mouseleave", onLeave)
frame = requestAnimationFrame(tick)
return () => {
cancelAnimationFrame(frame)
window.removeEventListener("mousemove", onMove)
window.removeEventListener("touchmove", onMove)
el.removeEventListener("mouseleave", onLeave)
}
}, [radius, minWeight, maxWeight, minWidth, maxWidth, useWidth])
return (
<div
ref={containerRef}
aria-label={text}
style={{ display: "flex", fontFamily, fontSize, color, lineHeight: 1 }}
>
{letters.map((char, i) => (
<span
key={i}
aria-hidden="true"
ref={(node) => (spansRef.current[i] = node)}
style={{
whiteSpace: "pre",
fontVariationSettings: `"wght" ${minWeight}`,
}}
>
{char}
</span>
))}
</div>
)
}
addPropertyControls(TextPressure, {
text: { type: ControlType.String, defaultValue: "PRESSURE" },
fontFamily: { type: ControlType.String, defaultValue: "Roboto Flex" },
fontSize: { type: ControlType.Number, defaultValue: 96, min: 16, max: 240 },
color: { type: ControlType.Color, defaultValue: "#111111" },
minWeight: { type: ControlType.Number, defaultValue: 200, min: 1, max: 1000 },
maxWeight: { type: ControlType.Number, defaultValue: 900, min: 1, max: 1000 },
useWidth: { type: ControlType.Boolean, defaultValue: true },
minWidth: { type: ControlType.Number, defaultValue: 75, min: 25, max: 151 },
maxWidth: { type: ControlType.Number, defaultValue: 130, min: 25, max: 151 },
radius: { type: ControlType.Number, defaultValue: 220, min: 50, max: 600 },
})
The font family you type must be loaded on the page. In Framer, upload the variable font file under Site Settings, then Fonts, or use the font through a text layer elsewhere on the site, and type its family name into the fontFamily control.
Why the Code Uses font-variation-settings
font-variation-settings accepts any number inside the font's axis range, so a letter can sit at weight 437 and width 112 at the same moment. Toggling between CSS classes tied to Regular and Bold can only snap between two states. The continuous values are what make the letters look pressed rather than switched.
What the Accessibility Lines Do
Splitting a word into one span per character can make some screen readers spell it out letter by letter. The aria-label on the wrapper gives assistive tech the whole word, and aria-hidden on the spans hides the fragments. The prefers-reduced-motion check skips the animation loop for visitors who asked their system for less motion, so they see the resting weight only.
Tuning the Feel of the Effect
Three settings shape the effect more than anything else:
- Radius. 100 to 150px gives a tight effect where only the letters under the cursor react. 250 to 400px gives a broad wave across several letters at once. Large headlines need a larger radius.
- Axis range. Weight 400 to 600 reads as refined. Weight 200 to 900 with width on is loud, and suits a single hero word.
- Resting state. The minimum values are what most visitors see first, and what phone and keyboard users may see all the time. Set them so the headline looks finished at rest. Many designs rest at a light, condensed shape and push toward heavy and wide.
Test with your real headline, not the word "PRESSURE". A long headline has more letters near the cursor at once, which can feel busy. If it does, shrink the radius or narrow the range.
Drop-In Option: FramerHub's Free Text Pressure Component
If you'd rather not maintain code, FramerHub's Text Pressure component is free and goes further than the snippet above:
- Three axes: weight, width and italic, each switched on or off on its own.
- Opacity and stroke: letters can fade with distance from the cursor, and an optional stroke adds a colored outline.
- Custom font URL: point it at your own variable font file.
- Layout options: Flex spreads the letters across the container width, and Scale to Fit fills the container height.
- Touch support: letters follow the mouse or touch position.
Copy it from the component page, paste it into your Framer project, set your text and font, then tune the axes and radius in the properties panel. It's free for unlimited personal and commercial projects, with no attribution. Browse more cursor-reactive type in the text effects category or the full component library, and if you're new to adding code components, our getting started with Framer components guide walks through the copy-and-paste flow.
Get the free Text Pressure component
Weight, width and italic axes, stroke, opacity and touch support. Paste it into Framer and tune it from the properties panel.
Where the Text Pressure Effect Works Best
- Short hero headlines: one bold word or a two or three word phrase, set large enough that each letter's change is easy to see.
- Portfolio and studio sites where type is part of the brand.
- Launch and campaign pages that want an interactive first impression above the fold.
Keep it away from body copy, navigation and anything a visitor needs to read quickly. Shifting letterforms slow reading down. One text pressure headline per page is usually right.
Common Mistakes With Text Pressure in Framer
- Using a font with a narrow axis range. If the loaded file's
wghtaxis only spans 400 to 500, the effect stays faint whatever you set in the component. Check the axis range first. - Losing spaces between words. Splitting text into spans can collapse spaces. Set
white-space: preon each span, as the snippet does. - Re-rendering React on every mouse move. Storing per-letter weights in state works on a short word and stutters on a long headline. Update styles in a
requestAnimationFrameloop instead. - Layout shift from width changes. Wider letters push their neighbors along the line. That movement is part of the look, but give the headline's frame room to grow, or use a fixed-width layout so the rest of the section doesn't jump.
- Putting it on every headline. The effect stops feeling special when the whole page does it. Save it for the hero.
Accessibility and Mobile Fallbacks
A mouse-only text pressure effect never triggers for keyboard users or on most phones, so the resting state is the design for a large share of visitors. Make sure it reads clearly on its own. Keep the headline as real HTML text so it stays selectable and readable by search engines and screen readers. Respect prefers-reduced-motion. On touch screens, either follow the touch position (as both the snippet and our component do) or show the resting weight and let the headline stand as static type.
FAQ
What is a text pressure effect? It's a typography effect where each letter in a headline gets heavier, wider or more slanted as the cursor gets close, then relaxes back to its resting shape as the cursor moves away.
Does text pressure require a variable font? Yes. The effect sets a font's weight (wght), width (wdth) or italic (ital) axis to any value in its range, many times a second. Only variable fonts have those continuous axes. A family of static files (Regular, Bold) can only jump between fixed cuts.
Will a text pressure effect work with my brand font? Only if your brand font ships a variable version with a weight or width axis. Check the font's specimen page for a variable file and its axis ranges before you design around the effect.
Does text pressure work on mobile? There's no hover on touch screens, so a mouse-only build shows the resting weight on phones. FramerHub's free Text Pressure component also follows touch position, so letters react while a visitor drags a finger across the headline.
Is a text pressure effect bad for SEO? No, as long as the headline is real HTML text and not an image or canvas. Search engines read the characters; the font axis animation is only styling on top.
Is the FramerHub Text Pressure component free? Yes. Text Pressure is a free FramerHub component you can use in unlimited personal and commercial projects, with no attribution required.

Shahul
Founder of FramerHub