Skip to main content
The Text component is a primitive typographic component for rendering styled text elements.

Import

Usage

Props

React.ElementType
default:"'span'"
Render as a different HTML element.
string
default:"'default'"
Text variant from theme.text. Common variants include default, heading, caps, small, etc.
ThemeUIStyleObject
Theme-aware styles for custom typography.

Inherited Props

Text extends Box and accepts:
  • All standard HTML span attributes (or attributes for the element specified with as)
  • Box spacing props (m, p, mx, my, px, py, etc.)
  • Box color props (color, bg, opacity)

Typography Props

These can be applied via the sx prop:
  • fontFamily: Maps to theme.fonts
  • fontSize: Maps to theme.fontSizes
  • fontWeight: Maps to theme.fontWeights
  • lineHeight: Maps to theme.lineHeights
  • letterSpacing: Maps to theme.letterSpacings
  • textAlign, textDecoration, textTransform, etc.

Examples

Basic Text

Paragraph Text

Colored Text

Responsive Font Size

Bold Text

Custom Typography

Text with Icon

Truncated Text