fit-my-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Summary

A package that allows you to adjust the text to the width of the container. Decreases or increases the font size to fit the text in the container.

Install via NPM

  npm install fit-my-text

Usage

  import fitMyText from 'fit-my-text';

  fitMyText(element, options);

Options

Option Default Description
element querySelector for element (required)
min 16 The minimum font size in pixels
max 512 The maximum font size in pixels
selectorType single Defines if you use single element or multiple elements (may be 'single' or 'multiple')

Options object

{
  min: 16,
  max: 512,
  selectorType: 'single'
}

Package Sidebar

Install

npm i fit-my-text

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

7.78 kB

Total Files

7

Last publish

Collaborators

  • michalwo