1.2.1 • Published 2 years ago

@ataverascrespo/react-textfit v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@ataverascrespo/react-textfit

  • Package created by Malte Wessel, 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

Installation

npm install @ataverascrespo/react-textfit

Usage

Props

  • 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.

Examples

<Textfit mode="single">
     Hello World!
</Textfit>
<Textfit mode="multi" forceSingleModeWidth={true} min={24} max={64}>
     Hello World!
</Textfit>

License

MIT

1.2.1

2 years ago

1.2.0

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago