Text
<Text />TailwindCSS ModulesProduction StableFoundational body-copy and typographic component with strict typographic scale, semantic variant hierarchy, polymorphic rendering via as, and predictable line-height ratios engineered for high-density SaaS and financial dashboards.
npx coloxo add text --style coloxo-cssimport { Text } from '@coloxo/ui';@coloxo/uiBundle: 0.82 KBDesign Tokens:
1. Variant & Hierarchy Matrix
Semantic roles for body, caption, overline, and code with live previews and token notes.
| Variant | Semantic role | Visual treatment & preview | CSS token base |
|---|---|---|---|
| body | Standard UI prose, multi-line descriptions, tabular records, and modal summaries. | High-throughput data ingestion pipeline completed 14,820 records in 1.4s without degradation. | color: var(--cx-color-text-primary) weight: 400 (normal) |
| caption | Secondary metadata, timestamps, input helper copy, form validation hints, footnote markers. | Encrypted via AES-GCM-256 · Verified by IAM Policy node #902 · Updated 3 minutes ago | color: var(--cx-neutral-500) weight: 400 (normal) |
| overline | Category tags, table column groups, section kicker badges, uppercase structural anchors. | INFRASTRUCTURE WORKLOADS // REGION US-EAST-1 | letter-spacing: 0.08em text-transform: uppercase |
| code | Inline code references, cryptographic hashes, UUIDs, environment vars, endpoint parameters. | process.env.COLOXO_API_KEY | font-family: JetBrains Mono border-radius: 4px |
2. Typographic Scale
Proportionally locked font-size to line-height ratios preventing clipping in compact table cells.
Sizes xs–lg
size="xs"Inline status · node-east-01
Micro data labels, badges, inline status text, nested directory nodes, compact graph legends.
size="sm"Pipeline completed 14,820 records in 1.4s.
Secondary descriptions, compact table cells, dialog supporting copy.
size="md"DEFAULTFoundational body copy for enterprise SaaS interfaces.
Default standard UI body copy for forms, settings panels, and modal content.
size="lg"Role Elevated to ClusterAdmin
Lead paragraphs, emphasized summaries, marketing subheads within product UI.
3. Polymorphic as prop
By default, <Text> emits a semantic <p>. Override as for inline emphasis, labels, and layout wrappers without polluting heading hierarchy.
p (default)
Paragraph block for multi-line prose.
span
strong
Settlement authorized by Treasury Ops.
em
Amount is pending dual approval before release.
div
label
4. Interactive Props Configurator
Automated vulnerability remediation deployed successfully to 43 edge gateways.
<Text> Automated vulnerability remediation deployed successfully to 43 edge gateways.</Text>5. Dark theme
High-contrast Dark Mode compliance ([data-cx-theme="dark"]) maintaining WCAG AAA optical legibility on dark surfaces.
VARIANT: BODYAutomated vulnerability remediation deployed successfully to 43 edge gateways.
VARIANT: CAPTIONEncrypted via AES-GCM-256 · Verified by IAM Policy node #902
VARIANT: OVERLINEINFRASTRUCTURE WORKLOADS //
VARIANT: CODE8cf2b910a4e2…
6. Enterprise layout compositions
Pairing overline, amount, caption, and code variants in financial and security surfaces.
TRANSACTION ID #TX-89410
CLEARED$1,420,980.50 USD
Cross-border SWIFT settlement to Swiss National Bank clearinghouse.
Timestamp: 2025-02-17 14:02:19 UTC
Verify Block →SECURITY LOG STREAM
IAM AUDITRole Elevated to ClusterAdmin
User identity verified via FIDO2 hardware authenticator key.
Event hash
8cf2b910...7. Accessibility & line-height contract
Strict compliance rules governing optical contrast, non-breaking line-height, and assistive technology trees.
Default body text exhibits a 13.8:1 contrast ratio against default canvas surfaces. Muted captions never drop below 4.5:1, fulfilling WCAG AA strict criteria for small copy.
All sizes specify explicit proportional line-heights (16px, 20px, 24px, 28px) ensuring that multi-line text blocks never bleed into adjacent table cells.
The as prop prevents Heading hierarchy pollution. Informational notices rendered as text do not masquerade as headings to Apple VoiceOver or NVDA.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| variant | "body" | "caption" | "overline" | "code" | body | Typographic function and default styling. |
| size | "xs" | "sm" | "md" | "lg" | md | Font-size / line-height scale (12/16 through 18/28). |
| weight | "regular" | "medium" | "semibold" | "bold" | — | Font weight override. |
| color | "primary" | "secondary" | "tertiary" | "quaternary" | "brand" | "error" | "success" | "warning" | "inherit" | — | Semantic color tone; variant defaults apply when omitted. |
| as | "p" | "span" | "div" | "strong" | "em" | "label" | "li" | "figcaption" | p | Polymorphic HTML element. |