Typography
Terminal-styled typography wrapper for consistent text styling. Provides variants for body text, prose content, and compact displays, plus semantic h1-h6 headings with sensible default sizing.
Installation
dgadd ships in @diffgazer/add on npm: pnpm add -D @diffgazer/add puts it on pnpm exec, and npx @diffgazer/add runs it without the install.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS from the installed package.
Usage
Semantic headings
Pass as="h1" through as="h6" to render semantic heading elements. Each level
ships with a sensible default size; pass an explicit size prop to override.
SectionHeader remains the right primitive for the small, uppercase, tracked
section labels common throughout the product surface; reach for Typography
when you need general semantic headings outside that pattern.
Weights and colors
weight and color are independent axes on every size. color="accent" reads
the theme accent token, so it stays a deliberate highlight in both palettes.
API Reference
Typography
Accessibility
Notes
Variants
Use 'default' for general UI text, 'prose' for longer-form content with wider line-height, and 'compact' for dense secondary information.
Semantic Elements
Use the 'as' prop to render the appropriate HTML element: 'p' for paragraphs, 'span' for inline text, 'div' for block content, and 'h1'-'h6' for semantic headings. Defaults to 'div'.
Heading Defaults
Each heading level has a default size (h1 = 3xl, h2 = 2xl, h3 = xl, h4 = lg, h5 = base, h6 = sm) and auto-defaults to bold weight. Pass explicit 'size' or 'weight' props to override.
Heading Semantics
Only 'as' decides the document outline: 'size' is purely visual and never changes the rendered element. Pick the heading level that follows the surrounding outline, then set 'size' to match the visual hierarchy — never pick 'as' to obtain a size.
Source
Install via CLI: pnpm exec dgadd add ui/typography.
Highlighted source loads after this disclosure opens. Browse the source repository.