2.0.1 • Published 2 years ago

use-text-fit v2.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
2 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

2 years ago

2.0.1

2 years ago

1.0.5

2 years ago

2.0.0

2 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago