Skip to main content
  1. Docs
  2. Components
  3. Type

Text

Running text, labels and inline code, on the type roles: a size, a weight and a tone from the tokens.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<span>Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

text.tsx
// From the package: a build keeps only what it uses.
import { Text } from "@qeetrix/react";

// Or from its own path.
import { Text } from "@qeetrix/react/text";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
size"sm" | "md" | "lg""md"12/16, 14/20 or 16/24.
weight"regular" | "medium" | "semibold""regular"400, 500 or 600.
tone"default" | "subtle" | "subtlest" | "disabled" | "inverse" | "brand" | "danger" | "success" | "warning" | "info"inheritA text colour; disabled only inside an inactive control.
monobooleanfalseFira Code at the same size.
truncateboolean | number—One line with an ellipsis, or a number of lines.
align"start" | "center" | "end"—Logical alignment.
renderReactElementa <span>A <p>, a <label>.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
text<span>data-size, data-weight, data-tone.

04

Numbers

Format them for the locale with the library's helpers.

count.tsx
import { formatNumber } from "@qeetrix/react";

<Text>{formatNumber(1284, "en-IN")} users</Text>
Next — TextAccessibility