Text Component
Overview
Section titled “Overview”The text-v1
component provides consistent typography styles across your application.
Basic Usage
Section titled “Basic Usage”<text-v1 variant="body">This is some text</text-v1>
Variants
Section titled “Variants”Heading
Section titled “Heading”Large heading text:
<text-v1 variant="heading">Main Heading</text-v1>
Standard body text:
<text-v1 variant="body">This is body text for paragraphs.</text-v1>
Smaller text for captions or secondary information:
<text-v1 variant="small">Small text for captions</text-v1>
Attributes
Section titled “Attributes”Attribute | Type | Default | Description |
---|---|---|---|
variant | 'heading' | 'body' | 'small' | 'body' | Text style variant |
data-key | string | - | Translation key for i18n |
With Translations
Section titled “With Translations”<text-v1 variant="heading" data-key="welcome"></text-v1>
Examples
Section titled “Examples”Multi-line Text
Section titled “Multi-line Text”<text-v1 variant="body"> This text component supports multiple lines and will maintain proper spacing and formatting.</text-v1>
Semantic HTML
Section titled “Semantic HTML”The component renders semantic HTML based on the variant:
heading
→<h1>
,<h2>
, etc.body
→<p>
small
→<small>