Skip to main content
Base text elements are styled automatically. No classes needed. All typography follows semantic HTML best practices.

Headings

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Paragraphs & Inline Text

<p>This is a paragraph with <strong>bold text</strong>, <em>italic text</em>, and <a href="#">a link</a>.</p>

<p>Here's some <code>inline code</code> and more text.</p>

Code Blocks

<pre><code>function hello() {
  console.log('Hello, World!');
}</code></pre>

Blockquotes

<blockquote>
  This is a blockquote. It's styled automatically.
</blockquote>

Lists

Unordered Lists

<ul>
  <li>Unordered list item 1</li>
  <li>Unordered list item 2</li>
  <li>Unordered list item 3</li>
</ul>

Ordered Lists

<ol>
  <li>Ordered list item 1</li>
  <li>Ordered list item 2</li>
  <li>Ordered list item 3</li>
</ol>

Horizontal Rule

<hr>

Typography Styles

Headings

Six levels of headings (h1-h6) with automatic sizing and spacing

Text Formatting

Strong, emphasis, links, and inline code with proper contrast

Code

Inline code and code blocks with monospace font

Lists

Ordered and unordered lists with proper indentation

Inline Elements

  • <strong> - Bold text with semantic meaning for importance
  • <em> - Italic text with semantic meaning for emphasis
  • <b> - Bold text for visual styling only
  • <i> - Italic text for visual styling only
  • <code> - Inline code snippets with monospace font
  • <pre> - Preformatted text blocks
  • <kbd> - Keyboard input
  • <samp> - Sample output
  • <var> - Variables
  • <mark> - Highlighted text
  • <small> - Fine print
  • <del> - Deleted text
  • <ins> - Inserted text
  • <sub> - Subscript
  • <sup> - Superscript

Complete Example

<article>
  <h1>Article Title</h1>
  <p>This is the introduction paragraph with <strong>important text</strong> and <a href="#">a link</a>.</p>
  
  <h2>Section Heading</h2>
  <p>Here's a paragraph with <code>inline code</code> and <em>emphasized text</em>.</p>
  
  <h3>Features</h3>
  <ul>
    <li>Feature one</li>
    <li>Feature two</li>
    <li>Feature three</li>
  </ul>
  
  <h3>Code Example</h3>
  <pre><code>const greeting = 'Hello, World!';
console.log(greeting);</code></pre>
  
  <blockquote>
    A relevant quote that adds context to the article.
  </blockquote>
  
  <hr>
  
  <h2>Conclusion</h2>
  <p>Final thoughts and summary.</p>
</article>

Semantic HTML

Oat UI encourages semantic HTML for better accessibility and SEO:

Use Headings Hierarchically

Start with <h1> and use heading levels in order (don’t skip levels)

Strong vs Bold

Use <strong> for importance, <b> for visual styling only

Em vs Italic

Use <em> for emphasis, <i> for visual styling only

Lists for Lists

Use <ul> or <ol> for lists, not <div> elements

Accessibility

  • Proper heading hierarchy for screen readers
  • Semantic elements convey meaning, not just appearance
  • Link text should be descriptive (not “click here”)
  • Code blocks use <pre><code> for proper announcement
  • Lists use proper <ul>/<ol> structure
  • Sufficient color contrast for text
  • Focus states on interactive elements

Best Practices

Use semantic HTML elements that match the content meaning
Maintain proper heading hierarchy (h1 → h2 → h3, etc.)
Use <strong> and <em> for semantic meaning, not styling
Write descriptive link text
Use <code> for inline code, <pre><code> for blocks
Don’t skip heading levels (e.g., h1 directly to h3)
Don’t use headings for styling - use CSS classes instead

CSS Variables

Typography uses the standard Oat UI CSS variables:
  • --text-1 through --text-9 - Font sizes (h1 uses larger, body uses middle range)
  • --leading-* - Line height values
  • --font-normal, --font-medium, --font-bold - Font weights
  • --foreground - Main text color
  • --muted-foreground - Secondary text color
  • --primary - Link color
  • --border - Border color for <hr>