Skip to content

Typography ​

A collection of semantic text and typography components for consistent, accessible, and flexible text rendering. Includes headings, body text, lead, muted, small, strong, emphasis, code, pre, gradient text, blockquotes, and more.


Import ​

ts
import {
  H1, H2, H3, H4, H5, H6,
  Text, Lead, Muted, Small, Strong, Em, Mark, Code, Pre,
  GradientText, Blockquote
} from '@odyssee/components';

Headings ​

Code Éditable
Résultat

Text Variants ​

Code Éditable
Résultat

Text Sizes ​

Code Éditable
Résultat

Font Weights ​

Code Éditable
Résultat

Text Alignment ​

Code Éditable
Résultat

Text Transformations ​

Code Éditable
Résultat

Inline Text Elements ​

Code Éditable
Résultat

Code Blocks ​

Code Éditable
Résultat

Gradient Text ​

Code Éditable
Résultat

Blockquotes ​

Code Éditable
Résultat

Line Clamp ​

Code Éditable
Résultat

Props ​

Headings (H1, H2, H3, H4, H5, H6) ​

NameTypeDefaultDescription
childrennode—Content of the heading
alignstring—Text alignment
colorstring—Text color
weightstringvariesFont weight
truncatebooleanfalseTruncate with ellipsis
uppercasebooleanfalseUppercase text
lowercasebooleanfalseLowercase text
capitalizebooleanfalseCapitalize first letter
lineClampnumber—Max lines before truncating
classNamestring—Additional CSS classes
...restany—Other props

Text ​

NameTypeDefaultDescription
childrennode—Content of the text
alignstring—Text alignment
colorstring—Text color
weightstring—Font weight
sizestring'base'Font size
truncatebooleanfalseTruncate with ellipsis
uppercasebooleanfalseUppercase text
lowercasebooleanfalseLowercase text
capitalizebooleanfalseCapitalize first letter
lineClampnumber—Max lines before truncating
asstring'p'Element tag to render
classNamestring—Additional CSS classes
...restany—Other props

Lead, Muted, Small ​

Same props as Text, with preset size and color.

Inline Elements ​

  • Strong: Renders <strong>, bold text.
  • Em: Renders <em>, italic text.
  • Mark: Renders <mark>, highlighted text.
  • Code: Renders <code>, inline code.
  • Pre: Renders <pre>, code block.
  • Del: Renders <del>, deleted text.
  • Ins: Renders <ins>, inserted text.
  • Underline: Renders <u>, underlined text.
  • Strikethrough: Renders <s>, strikethrough text.

GradientText ​

NameTypeDefaultDescription
fromstring—Gradient start color
tostring—Gradient end color
viastring—Optional middle color
directionstring'tl'Gradient direction
...TextAll Text props except color

Blockquote ​

NameTypeDefaultDescription
childrennode—Quote content
citestring—Citation/author
variantstring'default'Style variant
classNamestring—Additional CSS classes
...restany—Other props

Accessibility ​

  • All components use semantic HTML tags (<h1>, <p>, <strong>, etc.).
  • Headings and text are accessible to screen readers.
  • Use Lead, Muted, and Small for visual hierarchy, not for hiding important content.
  • Ensure color contrast for readability.

Best Practices ​

  • Use semantic headings (H1–H6) for document structure.
  • Use Lead for introductory paragraphs.
  • Use Muted and Small for secondary or fine print text.
  • Use GradientText for decorative headings or highlights.
  • Use Blockquote for quotations, with cite for attribution.
  • Use truncate and lineClamp for long text in constrained layouts.

Subcomponents ​

  • H1, H2, H3, H4, H5, H6: Headings
  • Text: Body text
  • Lead: Large lead paragraph
  • Muted: Muted/secondary text
  • Small: Fine print
  • Strong, Em, Mark, Code, Pre, Del, Ins, Underline, Strikethrough: Inline elements
  • GradientText: Text with gradient overlay
  • Blockquote: Quotation with optional citation

Released under the MIT License.