@namhong2001/react-textfit
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@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

Package Sidebar

Install

npm i @namhong2001/react-textfit

Weekly Downloads

169

Version

2.0.0

License

MIT

Unpacked Size

7.04 kB

Total Files

7

Last publish

Collaborators

  • namhong2001