Typography

Automatic prose styling and semantic text primitives for documentation and content-heavy interfaces.

Installation

npx shadcn@latest add @fulldev/typography

Usage

Use Typography as a wrapper around rendered content, markdown output, or regular HTML when you want the component to style its children automatically. Use the individual typography components when you want explicit primitives in a component example or custom layout.

Every typography component accepts size="sm", size="default", or size="lg". The default size keeps body text at the base font size. On the Typography wrapper, size only scales the wrapper-level heading and lead styles. Regular child prose such as paragraphs, lists, blockquotes, code, small text, and tables keeps its normal default size. Use the individual components’ own size prop when those elements need to change size.

import {
  Typography,
  TypographyA,
  TypographyBlockquote,
  TypographyH1,
  TypographyH2,
  TypographyH3,
  TypographyH4,
  TypographyInlineCode,
  TypographyLead,
  TypographyList,
  TypographyListItem,
  TypographyP,
  TypographyTable,
  TypographyTableCell,
  TypographyTableHead,
  TypographyTableRow,
} from "@/components/ui/typography"

Child elements

The Typography wrapper styles supported child elements directly. Headings, paragraphs, links, blockquotes, lists, tables, inline code, and preformatted code can be regular HTML.

Child components

TypographyH1

TypographyH2

TypographyH3

TypographyH4

TypographyP

TypographyA

TypographyBlockquote

TypographyTable

TypographyList

TypographyInlineCode

TypographyLead

Notes

  • Wrap long-form prose in Typography when you want sensible defaults for headings, paragraphs, lists, tables, and inline code.
  • Use the individual typography primitives when you want explicit semantic composition inside a component example or a custom layout.

API Reference

See the GitHub source code for more information on props.