Text
Text is a foundational element for communication, conveying information to users. It serves various purposes, including displaying content, headings, links, and other text-based elements.
Code Editor
Features
Provides different variants
Allows color customization
Enables text styling
Accepts custom attributes and className
Assigns the correct HTML tag
Allows text truncation
Ensures responsive design
Reference Links
Success Criterion Contrast
Anatomy
Import all parts and combine them together.
import { Text } from '@vortex-kit/vortex';
import type { TextProps } from '@vortex-kit/vortex';
<Text variant={{ xs: 'heading-md-mobile', sm: 'heading-md-desktop' }}>
Hey there!
</Text>
Variant
The text variants include for titles, text for paragraphs, and for links, each available in sizes , , , , , for both mobile and desktop.
heading
body
link
2xl
xl
lg
md
sm
xs
Code Editor
Color
The text color can be customized using the property. The property accepts the following values: props table.
color
color
Code Editor
Style
Text can be styled using the , , , and properties.
decoration
wrap
align
weight
Code Editor
Truncate
Text can be truncated using the property.
maxLines
Code Editor
Accessibility
Ensure that text meets the Success Criterion Contrast for readability and accessibility.
Key | Description |
---|---|
! | Text color must meet the contrast ratio of 4.5:1 for normal text and 3:1 for large text. |
!! | Change HTML tag using the as |