Fit-to-width statement

A headline that scales to fill the full width of its section on one line, with three stat tiles whose numbers each grow to fill their box.

fit-textdata-fit-textheadlinestatementstatsbig textinteractive

About this block

data-fit-text finds the largest font size that fits and refits when the container resizes, so a short line always fills the width. Without scripting the text keeps the size from its classes.

How to customize it

  • oneline fits the text on one line to the element width. boxoneline fits one line inside the element's own box (give it a height). box wraps the text and fits it inside its own box; multiline wraps and fits the parent's height.
  • data-fit-min and data-fit-max bound the size in pixels.
  • Keep the base text size class (text-3xl) as the no-script fallback.

Browse other blocks

Same library cards — preview live and grab the code from any block.

View full library