Text
Styles a run of text with a type-scale style and a semantic colour. Use it for any text app code styles, instead of a span with classes. Pass render to make it a heading or a paragraph.
React
Ready
Figma
React examples
Variants and tones
Active tracks
Track 207 entered the north zone.Small UAV, 420 m from the fence, heading south-east.Link lost 30 seconds ago32.0853° N, 34.7818° Eimport { Stack, Text } from "@kela-systems/ui-components"; export default function TextVariants() { return ( <Stack gap={3}> <Text variant="heading-md" render={<h3 />}> Active tracks </Text> <Text variant="body-md-regular">Track 207 entered the north zone.</Text> <Text variant="body-sm-regular" tone="neutral-secondary"> Small UAV, 420 m from the fence, heading south-east. </Text> <Text variant="body-sm-medium" tone="danger-primary"> Link lost 30 seconds ago </Text> <Text variant="mono-xs" tone="neutral-tertiary"> 32.0853° N, 34.7818° E </Text> </Stack> ); }
Props
Text
| Name | Default | Description |
|---|---|---|
variant"body-md-medium" | "body-md-regular" | "body-md-semibold" | "body-sm-medium" | "body-sm-regular" | "body-sm-semibold" | "body-xs-medium" | "body-xs-regular" | "body-xs-semibold" | "display-md" | "heading-lg" | "heading-md" | "heading-sm" | "heading-xs" | "mono-md" | "mono-xs" | ||
tone"alert-inverse" | "alert-primary" | "alert-secondary" | "alert-tertiary" | "brand-inverse" | "brand-primary" | "brand-secondary" | "brand-tertiary" | "danger-inverse" | "danger-primary" | "danger-secondary" | "danger-tertiary" | "disabled-primary" | "disabled-secondary" | "disabled-tertiary" | "info-inverse" | "info-primary" | "info-secondary" | "info-tertiary" | "neutral-inverse" | "neutral-primary" | "neutral-secondary" | "neutral-tertiary" | "success-inverse" | "success-primary" | "success-secondary" | "success-tertiary" | "update-inverse" | "update-primary" | "update-secondary" | "update-tertiary" | "warning-inverse" | "warning-primary" | "warning-secondary" | "warning-tertiary" | ||
truncateboolean | false |
It also takes the attributes of the HTML element it renders.
Related
Weigh Text against these before you choose.