https://github.com/damiangreen/isomorphic-react-fittext
React component that fits text on the screen.
https://github.com/damiangreen/isomorphic-react-fittext
fit-text fittext font-size isomorphic react
Last synced: 8 months ago
JSON representation
React component that fits text on the screen.
- Host: GitHub
- URL: https://github.com/damiangreen/isomorphic-react-fittext
- Owner: damiangreen
- License: mit
- Created: 2019-10-12T13:33:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-13T15:17:49.000Z (over 6 years ago)
- Last Synced: 2025-09-03T06:44:27.632Z (9 months ago)
- Topics: fit-text, fittext, font-size, isomorphic, react
- Language: TypeScript
- Homepage:
- Size: 30.3 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# isomorphic-react-fittext
`ReactFitText` is component that allows you to fit text automatically.
It fits boths horizontally and vertically and works in isomorphic applications.
It allows for component resizing and works in React 16+
Ported from https://github.com/gianu/react-fittext
## Install
- `npm install isomorphic-react-fittext` or
- `yarn add isomorphic-react-fittext`
## Use
```JavaScript
import ReactFitText from 'isomorphic-react-fittext';
const MyComponent = () => {
return
HELLO WORLD
};
```
### 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 minimum font size (in px) this component should use.
- maxFontSize: the maximum font size (in px) this component should use.