Skip to content

Typeset

Free

One class styles the plain HTML of an article or a page: headings, lists, quotes, code, and tables.

Tailwind CSS 4MIT + Commons Clause · 1 CSS file · 0 KB JavaScript

Faster tables in 2.4

Large tables now render only the rows in view. A list of 50,000 orders opens in under 100 ms, and sorting no longer blocks typing.

What changed

  • The header stays in view while you scroll.
  • Column widths come from minmax(), so long names wrap.
  • Filters run off the main thread.
We moved from 18 dropped frames to none on a mid-range phone.
RowsBeforeAfter
5,000240 ms38 ms
50,0002.1 s92 ms
LightDark
SmallBaseLarge
ArticleLegal
typeset

Install

Add the utility's CSS with the CLI, your coding agent, or by hand. It has no JavaScript.

Usage

Put the class on the element that holds the plain HTML: an article, a changelog entry, or a legal page.

post.tsx

Elements

Every plain HTML element inside gets a style. Gelatin UI parts inside (anything with data-slot) keep their own.

  • Texth1–h6pastrong · bem · imarksub · supblockquotehr
  • Lists and codeul · ol · lidl · dt · ddcodeprekbd
  • Media and dataimgvideofigure · figcaptiontable · th · tdcaptiondetails · summary

Turn it off inside

Put not-typeset on a part inside the article, such as a card or a form. It keeps its own styles.

The card below sits inside the article, but keeps its own type.

Get the weekly changelogSubscribe

Wide tables

Wrap a wide table in typeset-scroll. It scrolls in its own box on a phone.

RegionOrdersRevenueRefundsAverageGrowthMargin
Europe12,480€412,3001.8%€33.04+14%38%
North America9,215€338,9002.1%€36.78+9%35%

Options

The variables and the classes of the utility. Set a variable with an arbitrary property, such as [--typeset-size:1.125em].

NameKindDefaultDescription
--typeset-sizevariable1emThe body text size. Headings and code scale from it.
--typeset-leadingvariable1.75The line height of body text.
--typeset-flowvariable1.25emThe space between blocks: paragraphs, lists, quotes, tables.
--typeset-font-heading · -body · -monovariabletheme fontsThe fonts of headings, body text, and code. Body text takes the font of its parent.
--typeset-muted · --typeset-rulevariablemuted · borderThe color of quiet text such as captions, and of rules and table lines.
typeset-legalclass—A denser look for long legal text: smaller size and tighter flow.
typeset-scrollclass—Wrap a wide table in it, so the table scrolls in its own box.
not-typesetclass—Turns the styles off inside, for a card or a form in the article.