2.0.1 • Published 3 years ago

use-text-fit v2.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

use-text-fit

npm version

A hook used to fit text in one line inside its container.


Install

npm install use-text-fit

Usage

import useTextFit from 'use-text-fit';


function Title() {
    const {ref} = useTextFit();

    return <div ref={ref}>
        Lorem Ipsum
    </div>;
}
  1. Pass the ref to the text container element.
  2. Profit.
1.0.6

3 years ago

2.0.1

3 years ago

1.0.5

3 years ago

2.0.0

3 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago