Skip to content
R

react-textfit

React component to fit headlines and paragraphs into any element

by denis-sokolovFree

#384in UI Libraries
0In stores

Description

react-textfit is a React component that fits headlines and paragraphs into any element by sizing their text. It uses a binary search to find…

Highlights

  • Fits headlines and paragraphs into any element
  • Binary search for the right font size
  • Single mode for headlines, multi mode for paragraphs
  • Min, max and resize throttle props
  • onReady callback when text is fitted

Ratings & Reviews

No ratings yet

Be the first to rate react-textfit.

People also visit

R

react-text-truncate

Truncate text for React.js

UI Libraries
Launch
R

react-textarea-autosize

component for React which grows with content

UI Libraries
Launch
R

react-lines-ellipsis

Simple multiline ellipsis component for React.JS

UI Libraries
Launch
R

react-simple-typewriter

A simple react component for adding a nice typewriter effect to your project

UI Libraries
Launch
R

react-autosize-textarea

replacement for built-in textarea which auto resizes itself

UI Libraries
Launch
R

react-multiline-clamp

React component that uses the css line clamping

UI Libraries
Launch

react-textfit FAQ

What is react-textfit?

A React component that resizes headlines and paragraphs so they fit inside an element.

What is the difference between single and multi mode?

Single mode is for headlines and by default ignores the element's height. Multi mode is for paragraphs and wraps the text to fill the element.

Which props can I set?

mode, forceSingleModeWidth, the minimum and maximum font size in pixels, a throttle for window resizes, and onReady.

Is it open source?

Yes. It is MIT licensed and public on GitHub.

What are the best react-textfit alternatives?

Popular alternatives to react-textfit include react-text-truncate, react-textarea-autosize and react-lines-ellipsis. See all react-textfit alternatives

Developer Stuff

Badges