Styled typography primitives for headings, paragraphs, lists, tables, and inline elements. Use them as MDX component overrides or directly wherever you render prose.
Install
pnpm dlx shadcn@latest add https://sitex.full.dev/r/typography.jsonUsage
import {
TypographyH1,
TypographyInlineCode,
TypographyLead,
TypographyList,
TypographyListItem,
TypographyP,
} from "@/components/ui/typography"
export function Intro() {
return (
<>
<TypographyH1 size="lg">Getting started</TypographyH1>
<TypographyLead>Build static sites with MDX and React.</TypographyLead>
<TypographyP>
Install with <TypographyInlineCode>pnpm add</TypographyInlineCode> and
create your first page.
</TypographyP>
<TypographyList as="ol">
<TypographyListItem>Install the package.</TypographyListItem>
<TypographyListItem>Add a page.</TypographyListItem>
</TypographyList>
</>
)
}Key parts:
- Headings:
TypographyH1throughTypographyH4, each with asizeprop (sm,default,lg) that steps the font size up or down one level. - Text:
TypographyP,TypographyLead(larger muted intro text),TypographyBlockquote,TypographyA(underlined link), andTypographyInlineCode. - Lists:
TypographyListrenders aulby default or anolviaas="ol"; useTypographyListItemfor items. - Tables:
TypographyTable(wrapped in a scrollable bordered container, styleable viacontainerClassName) withTypographyTableRow,TypographyTableHead, andTypographyTableCell; the cells respect thealignattribute. Typographyis a generic wrapper (divby default, changeable viaas) with asizeprop, useful as a prose container.