use-text-fit 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>; } Pass the ref to the text container element. Profit.