1.1.0 • Published 5 years ago
yarft v1.1.0
YARFT
Yet another react fit text ... component!
Features
- Scales text down to fit its parent element.
- Built for React 16.
Installation
npm i yarft
Used on
Usage
import React from 'react'
import FittedText from 'yarft'
const BigHello = () => (
<FittedText>
Hello!
</FittedText>
)
Documentation
Properties | Type | Default | Description |
---|---|---|---|
defaultFontSize | Number | 200 | The default font size (in px) the text will be scale down from. |
windowObject | Object | undefined | A window object. Ex: the return value of window.open(...) . Useful for popups and iframes. |
Changelog
- 1.0.0 - Fit text on vertical overflow
- 1.1.0 - Fit text on horizontal overflow
- 1.1.0 -
windowObject
: new property to allow users to pass a different window to add the resize listeners to. parent
: new property to let text fit to a given parent node.
Contributing
- Fork this repo
- Add stuff
- Create a PR
Building
npm run-script build
Credits
Thanks to rmaruizzo for this sweet readme template :)