# 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.

Package: `@kela-systems/ui-components` 4.1.0

```tsx
import { Text } from "@kela-systems/ui-components";
```

Links (Kela sign-in needed): [Storybook](https://main--6af1efd9453270bb59a6c00c.chromatic.com/?path=/docs/typography-text--docs), [Source](https://github.com/Kela-Systems/kela/tree/main/packages/next/ui-components/src/text), [Figma](https://www.figma.com/design/anhlwrbFM6mUiL0klxeK1I/ARK---Design-System?node-id=22-1400)

## Examples

### Variants and tones

```tsx
import { 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

A `className` on a part adds layout only: placement, sizing and spacing. Pick a look with a variant.

### Text

| Variant | Values | Default |
| --- | --- | --- |
| `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` |  |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `truncate` | `boolean` | `false` |  |

Also takes the attributes of the HTML element it renders.

## Related

- [Stack](https://ark.kela.design/product/components/stack.md)
