datui
Color scheme

Typography

Typography

Semantic text presets on datui's type scale: DisplayTitle, Title, Headline, Text, Paragraph, Subhead, Footnote, Caption and EllipsisText.

import { Title, DisplayTitle, Headline, Text, Paragraph, Subhead, Footnote, Caption, EllipsisText, Typography } from "datui";

Playground

The quick brown fox

<Title level="1" weight="semibold">The quick brown fox</Title>

Examples

Type scale

Display title

Title 1

Title 2

Title 3

Headline 1

Headline 2

Text — default body copy

Paragraph — multi-line copy for longer descriptions and articles.

SubheadFootnoteCaption 1Caption 2Caption 3

Weight, element and caps

weight, as and caps adjust any preset.

Regular title

Bold title

Headline rendered as a paragraph

Section label

Truncation

EllipsisText clamps to maxLines and exposes the full text as a native tooltip.

datui components share one token set, so spacing, radii and type stay consistent no matter how many you combine on a page.datui components share one token set, so spacing, radii and type stay consistent no matter how many you combine on a page.

Accessibility

  • Title and DisplayTitle render h1–h4 matching level; override with as when the visual size and document outline differ.
  • Paragraph renders <p>; Text, Subhead, Footnote and Caption render <span>.
  • caps only changes presentation; screen readers read the original text.

API

Title

Section and page headings. Renders `h1`–`h3` by level.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1 | 2 | 3—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

DisplayTitle

Hero-sized headings. Renders `h1`–`h4` by level.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1 | 4 | 2 | 3—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

Headline

Emphasized short text such as card titles.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1 | 2—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

Text

Default body text.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

Paragraph

Multi-line body copy.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

Subhead

Secondary text under titles. Renders a `span`; pass `as` for a heading.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

Footnote

Small supporting text.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

Caption

Labels, metadata and fine print.

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
level1 | 2 | 3—
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—

EllipsisText

Truncates text with an ellipsis after `maxLines` lines and exposes the full text as a tooltip.

PropTypeDefaultDescription
classNamestring—
maxLinesnumber1Clamp to this many lines.
maxWidthstring | number—Max width of the text box (CSS length or px number).

Typography

Base text primitive. Prefer the semantic presets (`Title`, `Text`, `Caption`, ...).

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>spanElement to render.
capsboolean—Uppercase with letter spacing.
classNamestring—
inlineboolean—Render as `inline` instead of block.
normalizebooleantrueRemove default margins so the text sits flush in layouts.
weightTypographyWeight—