React Component that resizes text to fit into a container
Component that resizes font-size of children to fit the parent container.
Supports Typescript
<TextResize defaultFontSize={26}>
<p>Lorem Ipsum...</p>
</TextResize>
<TextResize defaultFontSize={26}>
Lorem Ipsum...
</TextResize>
<TextResize defaultFontSize={26}>
Lorem Ipsum...
<div>Lorem Ipsum...</div>
<p>Lorem Ipsum...</p>
</TextResize>
<TextResize defaultFontSize={26} minFontSize={14} maxFontSize={36}>
<p>Lorem Ipsum...</p>
</TextResize>
Uses binary search to find the right font-size - Blazing fast!
Uses useRef (React Hooks) to access the components and check the dimension.