Skip to content

Typography

Typography

Text component for consistent typography with predefined styles and semantic HTML.

Import

import { Typography } from '@primitivekit/astro';

Basic Usage

<Typography>Content</Typography>

Props

No props available.

Customization

The Typography component supports CSS variables for complete customization:

<Typography style={{
  '--typography-bg-color': '#007bff',
  '--typography-text-color': '#ffffff'
}}>Custom</Typography>

Design Tokens

The following design tokens are available for customization:

  • --typography-font-family
  • --typography-font-size
  • --typography-font-weight
  • --typography-line-height
  • --typography-letter-spacing
  • --typography-text-align
  • --typography-text-transform
  • --typography-text-decoration
  • --typography-color
  • --typography-margin-top
  • … and 27 more

Accessibility

The Typography component is fully accessible and follows WCAG 2.1 AA standards:

  • ✅ Semantic HTML elements
  • ✅ Keyboard accessible
  • ✅ Focus visible indicator
  • ✅ Proper ARIA attributes
  • ✅ Screen reader compatible
  • ✅ Touch target size (44x44px minimum)
  • ✅ Color contrast compliance

Keyboard Navigation

KeyAction
TabMove focus to/from component

Related Components

  • Avatar - Component for displaying user profile images or initials in a circular or rounded container.
  • Tag - Removable label component for displaying tags, filters, or selections.
  • Table - Data display component for showing structured data in rows and columns with sorting and pagination.
  • Collapse - Component for showing and hiding content sections with expand/collapse animation.
  • Image - Enhanced image component with lazy loading, fallback, and aspect ratio support.

See Also