Skip to content

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

Notifications You must be signed in to change notification settings

itayganor/use-text-fit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published