Answers for "scale text in div react"

1

scale text in div react

import useFitText from "use-fit-text";

function name(){
  const { fontSize, ref } = useFitText({maxFontSize: 240, minFontSize: 181});

  return (
    <div ref={ref} style={{ fontSize, height: 72, width: 240 }}>
      <div id="someId">Your Text</div>
    </div>
  );
}
Posted by: Guest on August-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language