Skip to content
Playground

Text

A polymorphic typography primitive using Zenos semantic type scales.

A polymorphic typography primitive using Zenos semantic type scales.

Security overview

Monitor assets, policies, and workspace activity.

pnpm add @zentara-co/zenos-ui
TSX
import { Text } from "@zentara-co/zenos-ui";

Heading sizes h1 through h6 choose matching HTML heading elements by default. h7 is a visual heading style and renders a paragraph because HTML has no seventh heading level.

h1

Zenos heading

h2

Zenos heading

h3

Zenos heading

h4

Zenos heading

h5
Zenos heading
h6
Zenos heading
h7

Zenos heading

Body text uses large, medium, and small scales. Choose weight="regular" (400), medium (500), semibold (600), or bold (700). Weight only affects body; heading, emphasis, and code roles own their weight through their type tokens.

In 0.2.2, body bold changes from 600 to 700. Use semibold to retain the previous 600 weight. Theme overrides can customize the corresponding --font-weight-body-* tokens.

Body l

Regular text supports the primary reading flow.

Medium text adds measured emphasis.

Semibold text distinguishes labels from surrounding copy.

Bold text marks the strongest body emphasis.

Body m

Regular text supports the primary reading flow.

Medium text adds measured emphasis.

Semibold text distinguishes labels from surrounding copy.

Bold text marks the strongest body emphasis.

Body s

Regular text supports the primary reading flow.

Medium text adds measured emphasis.

Semibold text distinguishes labels from surrounding copy.

Bold text marks the strongest body emphasis.

Use type for the typography role rather than approximating it with arbitrary font classes. italic can be combined with any role when the content convention calls for it.

Body text is the default for paragraphs and descriptions.

Emphasis uses the dedicated emphasis type treatment.

const status = "healthy";

Italic text can mark titles, terms, or a change in voice.

Colors describe text meaning and hierarchy. Use default, subtle, and subtlest for hierarchy; status colors for actual state; and contextual colors only on surfaces where their contrast role applies.

Hierarchy

default

subtle

subtlest

Meaning

brand

danger

warning

success

information

Context

contrary

selected

visited

type and size control visual typography; as controls the rendered element. Preserve a logical heading hierarchy even when design calls for a smaller visual size. Polymorphic props and refs follow the selected element.

Semantic h2 with h4 styling

Inline metadata rendered as a span

truncate applies a single-line ellipsis. maxLines clamps longer copy from two to six lines. Neither adds a tooltip; provide another way to access complete content when truncation hides information needed for a task.

Single line

audit-export-production-eu-central-1-with-an-intentionally-long-file-name.json

Three lines

This workspace description contains more detail than the surrounding card can show at once. Line clamping keeps the layout stable, but the complete text should remain available from another view whenever users need to read or act on all of it.

Start

Center

End

Variants

type: headingtype: bodytype: emphasistype: codeweight: regularweight: mediumweight: semiboldweight: boldalign: startalign: centeralign: endalign: justifycolor: defaultcolor: subtlecolor: subtlestcolor: brandcolor: dangercolor: warningcolor: successcolor: informationcolor: contrarycolor: selectedcolor: visited

Sizes

h1h2h3h4h5h6h7lms

API

PropTypeDefaultDescription
as ElementType p Rendered semantic element.
type heading | body | emphasis | code body Typography family.
size TextSize m Heading or body scale.
weight regular | medium | semibold | bold regular Body font weight; ignored by other typography roles.
align start | center | end | justify — Text alignment.
color TextColor default Semantic foreground color.
italic boolean false Applies italic styling.
truncate boolean false Applies a single-line ellipsis and takes precedence over maxLines.
maxLines number — Clamps content to two through six lines.
native props React.HTMLAttributes for the selected element — Forwards native attributes, events, aria-*, data-*, className, style, and ref.

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

Choose semantic elements from document structure, then apply the required visual style. Do not skip heading levels to obtain a smaller font. Color does not communicate meaning by itself, and justified text can reduce readability in narrow columns. Truncated text remains present in the accessibility tree, but sighted users still need a discoverable route to the full value when it affects a decision.