Overview
TheAxText component provides a unified API for rendering text across the AxMed design system with predefined variants, weights, colors, and utility features like ellipsis truncation.
Import
Props
Text style variant from the design system. Available options:Headings:
"heading-4xl"- Extra large heading (h1)"heading-3xl"- 3XL heading (h2)"heading-2xl"- 2XL heading (h3)"heading-xl"- XL heading (h4)"heading-lg"- Large heading (h5)"heading-md"- Medium UI label (14px, semibold)"heading-sm"- Small UI label (13px, semibold)
"body-xl"- Extra large body text"body-lg"- Large body text"body-md"- Medium body text (default)"body-sm"- Small body text"body-xs"- Extra small body text
Text content to render
Font weight — applies to body variants only (headings have fixed weights):
"regular"- Normal font weight (400)"medium"- Medium font weight (500)"semibold"- Semibold font weight (600)
Text color from design system:
"primary"- Primary text color (default)"secondary"- Secondary/muted text color"link"- Link/interactive color"disabled"- Disabled state color"inherit"- Inherit from parent
Apply italic style
Apply underline decoration
Use monospace font (Fira Code) for code snippets
Override the rendered HTML element. Available options:
"h1","h2","h3","h4","h5","h6"- Heading elements"p","span","label","div"- Container elements
Truncate text with ellipsis. Pass When
true for single-line truncation, or an object for advanced configuration:tooltip is true, the full children text is shown in the tooltip.Additional CSS classes to apply
Inline styles to apply
Type Definitions
Usage Examples
Headings
Body Text with Weights
Color Variants
Text Decorations
Ellipsis Truncation
Semantic HTML Override
Accessibility
- The component automatically maps variants to semantic HTML elements by default
- Use the
asprop to override when needed for proper document structure - Ellipsis truncation includes automatic tooltip detection for screen readers
- Color contrast ratios meet WCAG guidelines for all color variants