@dalee9000/react19-ts-textfit
v1.0.2
Published
Updated for React 19 and TypeScript; a React component to fit headlines and paragraphs into any element.
Maintainers
Readme
@dalee9000/react19-ts-textfit
- New version of the react-textfit package, updated for React 19 and TypeScript by David A. Lee
- Forked from react18-textfit package by Alex Taveras-Crespo
Installation
npm install @dalee9000/react19-ts-textfitUsage
Props
mode- "single" | "multi" (default)forceSingleModeWidth- boolean - ignore element height when true and mode is single (default = true)mix- number - min font sizemax- number - max font sizethrottle- number - window resize throttle in millisecondsonReadyfunction - called when text is fitted.
Examples
<Textfit mode="single">
Hello World!
</Textfit><Textfit mode="multi" forceSingleModeWidth={true} min={24} max={64}>
Hello World!
</Textfit>License
MIT
