Skip to content

namhong2001/react-textfit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

React component to fit headlines and paragraphs into elements

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%