2.0.0 • Published 1 year ago

@namhong2001/react-textfit v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@namhong2001/react-textfit

v1

Diff from malte-wessel/react-textfit

  • make run possible on react v18

Install

npm install @namhong2001/react-textfit@1

Types

npm install @types/namhong2001__react-textfit@npm:@types/react-textfit --D

v2

Originate from malte-wessel/react-textfit but fully rewritten with function component and hooks by typescript

Install

npm install @namhong2001/react-textfit

Types

Included

Supported props

  • mode (single|multi) force singleline or multiline. default multi
  • min (Number) minimum font size. default 0
  • max (Number) maximum font size. default 300

example

<Textfit>
  {myText}
</Textfit>

<Textfit mode="single">
  {myText}
</Textfit>

<Textfit mode="single" min={10} max={50}>
  {myText}
</Textfit>

LICENSE

MIT