fit title
a title that steps down until the whole of it fits its box. it measures the words, so it never guesses from how many there are.
bunx --bun shadcn@latest add @mk/fit-titleexample
the ladder runs hero, headline, section, long, and the title prints at the first step that holds all of it in the box. hero needs a full panel’s 784 px, so anything narrower starts at headline and a phone never prints hero. clear’s claim runs the same way one step up: display at a full panel, hero below it.
reply to sam about chapter 7
check whether the deck for thursday's review still matches the numbers sam sent after the last call
check whether the deck for thursday's review still matches the numbers sam sent after the last call, and fix the ones that moved, then send the whole thing back to the three people who asked for it
reply to sam about chapter 7
check whether the deck for thursday's review still matches the numbers sam sent after the last call
check whether the deck for thursday's review still matches the numbers sam sent after the last call, and fix the ones that moved, then send the whole thing back to the three people who asked for it
at any width
the same words at three widths. the title fits again when its box changes size and when a face arrives.
reply to sam about the chapter 7 notes and say when the next draft goes up
reply to sam about the chapter 7 notes and say when the next draft goes up
reply to sam about the chapter 7 notes and say when the next draft goes up
reply to sam about the chapter 7 notes and say when the next draft goes up
reply to sam about the chapter 7 notes and say when the next draft goes up
reply to sam about the chapter 7 notes and say when the next draft goes up
the cut
past the foot of the ladder the title cuts at the last whole word that fits, measured at the width it prints. a screen reader still gets every word, and so does the tooltip. touch has no hover, so a title that can cut links to the page that prints it whole.
by lines
outside a held box, lines gives the title its room and steps gives it a shorter ladder, so a run’s page header stays at the size of every other page.
check whether the deck for thursday's review still matches the numbers sam sent after the last call, and fix the ones that moved, then send the whole thing back to the three people who asked for it
check whether the deck for thursday's review still matches the numbers sam sent after the last call, and fix the ones that moved, then send the whole thing back to the three people who asked for it
parts
FitTitle- the heading, an
h1untilrendersays otherwise. its children are the title as one string. give it a height from its slot, or passlines. steps- the steps it may print, largest first.
lines- the most lines it may take, in place of a held height.
href,link- where the whole title prints: a plain
href, or the app’s router link throughlink.