react-fittext
A React plugin to fit the text in the screen
Last updated 3 years ago by denis-sokolov .
MIT · Bugs · Original npm · Tarball · package.json
$ cnpm install react-fittext 
SYNC missed versions from official npm registry.

React Fit text

This component is a port of the famous fit text plugin for jQuery to use with React.

This component is 100% jQuery Free.

Homepage: http://softwarepsychonaut.com/react-fittext

Usage

Simply wrap your text component inside <ReactFitText>

// In your React component

var ReactFitText = require('react-fittext');
...

<ReactFitText>
  <h2>Testing React Fittext</h2>
</ReactFitText>

and you're good to go!

If you want to see a live demo of this component, you can check the homepage.

Parameters

There are few options you can send to the component to modify it default behaviour:

  • compressor: you can tweak this variable to increase / decrease the font-size. Default is 1.
  • minFontSize: the minimun font size (in px) this component should use.
  • maxFontSize: the maximum font size (in px) this component should use.

Issues / PR

If you found any issue with this component, please report it.

If you want to improve the code, feel free to create a PR!

Thanks

Current Tags

  • 1.0.0                                ...           latest (3 years ago)

10 Versions

  • 1.0.0                                ...           3 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.5                                ...           5 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (2)
Downloads
Today 57
This Week 1,579
This Month 12,317
Last Day 789
Last Week 4,103
Last Month 20,139
Dependencies (2)
Dev Dependencies (23)

Copyright 2014 - 2017 © taobao.org |