react-text-resize
v1.0.0
Published
A React component which decreases the size of its text content as more text is added. It allows for granular control over how it should scale down.
Downloads
4
Maintainers
Readme
React Text Resize
Control the size of your paragraphs based on its length.
Shorter lines will start at the max
size, then decrease in size until the maximum number of characters (capAt
) is reached; at which point it will use the min
size and stop decreasing.
Installation
npm install react-text-resize
Usage
The component accepts DOM elements as children to count its number of characters:
<TextFit className="optional-classes" min="16" max="46" capAt="150">
<p>“Wise quotes are shorter”</p>
</TextFit>