yarft

1.1.0 • Public • Published

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

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

  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 :)

Package Sidebar

Install

npm i yarft

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

10.2 kB

Total Files

6

Last publish

Collaborators

  • samsalinas