# Text

Body copy, captions and inline text on the type scale, plus Prose for long rich text.

- Family: display
- Import: `import { Text, Prose } from "@senvenli/react/display";`
- Page: https://design.senvenli.com/docs/components/text
- JSON: https://design.senvenli.com/docs/components/text.json

## Example: A paragraph

`elementType="p"` gives body copy its semantics and a readable line length.

```tsx
import { Text } from "@senvenli/react/display";

export default function Example() {
  return (
    <Text elementType="p">
      Your order has been confirmed and will ship within two business days. We will email a tracking number to Ada Lovelace as soon as the
      package leaves the warehouse.
    </Text>
  );
}
```

## Examples

### Sizes

Body by default; large for lead text, small for captions, code for identifiers.

```tsx
import { Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";

export default function Example() {
  return (
    <Stack space="space-100">
      <Text size="body-large">Three invoices are due this week.</Text>
      <Text>Three invoices are due this week.</Text>
      <Text size="body-small">Three invoices are due this week.</Text>
      <Text size="code">INV-2026-0318</Text>
    </Stack>
  );
}
```

### Tones

Subtle tones for secondary text; semantic tones only when the text carries that meaning.

```tsx
import { Text } from "@senvenli/react/display";
import { Stack } from "@senvenli/react/layout";

export default function Example() {
  return (
    <Stack space="space-100">
      <Text weight="medium">Invoice INV-2026-0318</Text>
      <Text tone="subtle">Issued to Ada Lovelace</Text>
      <Text tone="subtlest" size="body-small">
        Last edited March 18, 2026
      </Text>
      <Text tone="success">Paid in full</Text>
      <Text tone="danger">Payment failed</Text>
      {/* Figures that sit in a column or change in place line up with `isNumeric`. */}
      <Text isNumeric>$1,240.00</Text>
    </Stack>
  );
}
```

### Long-form text

Prose styles rendered HTML or Markdown: headings, lists, quotes, code and links.

```tsx
import { Prose } from "@senvenli/react/display";

export default function Example() {
  return (
    <Prose>
      <h2>Returns</h2>
      <p>
        You can return most items within <strong>30 days</strong> of delivery. Start from the order page and print the prepaid label.
      </p>
      <ul>
        <li>Items must be unused and in their original packaging.</li>
        <li>
          Refunds go back to the original payment method, quoting the order ID, such as <code>ORD-1042</code>.
        </li>
      </ul>
      <blockquote>
        <p>Custom orders cannot be returned unless they arrive damaged.</p>
      </blockquote>
    </Prose>
  );
}
```

## Guidelines

### When to use it

- Any run of app text: descriptions, help text, captions, numbers.
- Prose: long formatted content such as articles or terms.

### Use something else when

- [heading](https://design.senvenli.com/docs/components/heading.md): The words title a page or section.

### Do and avoid

- Keep legal and body text at `body` or larger; use `subtle` and `subtlest` tones for secondary text only.

## Accessibility

Built in:

- Tones meet WCAG AA contrast on every surface token.

You provide:

- `elementType="p"` for paragraphs so the text has the right semantics.

## API reference

### Text

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| size | `TextSize` | `"body"` | no |  |
| tone | `TextTone` | `"default"` | no |  |
| weight | `"medium" \| "regular"` | `"regular"` | no |  |
| elementType | `"div" \| "span" \| "p"` | `"span"` | no | `p` for a paragraph (kept under ~70 characters a line), `span` inline, `div` for a block. |
| isNumeric | `boolean` |  | no | Lines up figures in columns and changing values. |
| truncate | `boolean` |  | no | One line, cut with an ellipsis where its container ends (a table cell, a card title). |
| children | `React.ReactNode` |  | yes |  |

### Prose

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| children | `React.ReactNode` |  | yes |  |

### Tokens it reads

`--ds-background-neutral`, `--ds-border-bold`, `--ds-link`, `--ds-radius-xsmall`, `--ds-space-050`, `--ds-space-100`, `--ds-space-200`, `--ds-space-250`, `--ds-space-300`, `--ds-space-400`, `--ds-text`, `--ds-text-brand`, `--ds-text-danger`, `--ds-text-information`, `--ds-text-subtle`, `--ds-text-subtlest`, `--ds-text-success`, `--ds-text-warning`, `--font-ds-mono`

## Related

- [heading](https://design.senvenli.com/docs/components/heading.md)
