1.1.0 • Published 5 years ago

yarft v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

YARFT

npm

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

Bible Verse Display

Usage

import React from 'react'
import FittedText from 'yarft'

const BigHello = () => (
  <FittedText>
    Hello!
  </FittedText>
)

Documentation

PropertiesTypeDefaultDescription
defaultFontSizeNumber200The default font size (in px) the text will be scale down from.
windowObjectObjectundefinedA 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

  1. Fork this repo
  2. Add stuff
  3. Create a PR

Building

npm run-script build

Credits

Thanks to rmaruizzo for this sweet readme template :)