Components / Text animationsv1.0.0 · updated 2026-09-30
Fit Text
Free · MITA binary search against Archivo's width axis (62–125) makes one line fill its container edge to edge, re-solving on resize and once web fonts load. Falls back to font-size when the narrowest width still overflows.
textvariable fontresponsive
Customize
Accent
Install
No dependencies beyond React. Copy the file and import it.
- Copy
FitText.tsxfrom the Code tab intocomponents/brazen/. - Make sure the Brazen tokens are loaded (
tokens.css); colours and timing come from them. - Import it and pass the props below.
Props 5
| Prop | Type | Default | Description |
|---|---|---|---|
children | string | — | The line to fit. |
min | number | 62 | Narrowest width-axis value. |
max | number | 125 | Widest width-axis value. |
rise | boolean | false | Letters rise in on mount. |
split | string | — | Substring to colour with --hot. |
Features
- Variable-font width solve
- ResizeObserver driven
- Optional letter rise on load
- Highlight a substring in the hot colour
Dependencies
react@>=19peer
Works with
- React 19
- Next.js 15+
- TypeScript
Reduced motion
Fits the line; the letter rise is skipped.