Yet another react fit text ... component!
- Scales text down to fit its parent element.
- Built for React 16.
npm i yarft
import React from 'react'
import FittedText from 'yarft'
const BigHello = () => (
<FittedText>
Hello!
</FittedText>
)
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. |
- 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.
- Fork this repo
- Add stuff
- Create a PR
npm run-script build
Thanks to rmaruizzo for this sweet readme template :)