Updated for React 18 and TypeScript; a React component to fit headlines and paragraphs into any element.
npm install @ataverascrespo/react18-ts-textfit@ataverascrespo/react18-ts-textfit
=========================
* New version of the react-textfit package, updated for React 18 and TypeScript by Alex Taveras-Crespo
* Fit headlines and paragraphs into any element by using binary search to find the correct fit
bash
npm install @ataverascrespo/react18-ts-textfit
`
Usage
$3
* `mode` - "single" | "multi" (default)
* `forceSingleModeWidth` - boolean - ignore element height when true and mode is single (default = true)
* `mix` - number - min font size
* `max` - number - max font size
* `throttle` - number - window resize throttle in milliseconds
* `onReady` function - called when text is fitted.
$3
`javascript
Hello World!
`
`javascript
Hello World!
``