react-fitclamp
v0.2.1
Published
Fits and clamps typography
Downloads
51
Readme
react-fitclamp
Trims
Install
npm install --save react-fitclamp
Usage
import React, { Component } from "react"
import FitClamp from "react-fitclamp"
class Example extends Component {
render() {
const containerClass = "card-medium"
const textSizes = ["size-1", "size-2", "size-3"]
const text = "Lorem ipsum dolor sit amet"
return (
<FitClamp className={containerClass} textClasses={textSizes}>
{text}
</FitClamp>
)
}
}
Make sure the CSS for textClasses contains line-height setting in percentages, integers or pixels. Keywords like "normal" will not work.
License
MIT © some1else