> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Text Component

## Article: Text Component

## Article Link: https://dev.wix.com/docs/wix-design-system/components/typography/text-component.md

## Article Content:

# Text

_Components/Typography_

Interactive docs page: <https://wix-pages.com/design-system-documentation/#/component/text>

## Overview

```jsx
<Text>
  Welcome to your blog post. Use this space to connect with your readers and
  potential customers in a way that’s current and interesting. Think of it as an
  ongoing conversation where you can share updates about business, trends, news,
  and more.
</Text>;
```

Text is a typography component used to create a wide variety of content including guidance, information, descriptions, labels and more.

### Do

- Use it to display text paragraphs formed from a single sentence, or multiple sentences.
- Use it to display form element values and labels.

### Don't

- Don't use it as a title for a section or a widget. Use `<Heading/>` instead.
- Don't use it to highlight status, use `<Badge/>` instead.

### Feature examples

#### Size

Control the size of the text with the `size` prop. It supports 3 sizes:

- `medium` is the default for all common cases of running text.
- `small` is for field labels and secondary content.
- `tiny` is for short messages of minor importance.

Note: Use `tiny` in exceptional cases only, as it's hard to read, and not recommended for accessibility.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text size="medium">
    Medium size is a default size that's used most of the time.
  </Text>
  <Text size="small">
    Small size is used where medium doesn't fit or content is less important.
  </Text>
  <Text size="tiny">
    Tiny size is used when there's no space or it's the last thing users need to
    see.
  </Text>
</StorybookComponents.Stack>;
```

#### Weight

Control the weight of the text with the `weight` prop. It supports 3 weights:

- `bold` emphasizes running text.
- `normal` is for form field values and button labels.
- `thin` is the default for all regular paragraphs.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text weight="bold">Bold weight is meant to emphasize running text.</Text>
  <Text weight="normal">
    Normal weight is for form field values and buttons.
  </Text>
  <Text weight="thin">
    Thin weight is for running text. Use it for all regular paragraphs.
  </Text>
</StorybookComponents.Stack>;
```

#### Skin

Control the color of text with the `skin` prop. It supports 6 skins:

- `standard`
- `premium`
- `success`
- `error`
- `disabled`
- `primary`

`standard` skin can be placed on backgrounds with color. All other skins can be used only on white or gray backgrounds.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text skin="standard">Standard skin appears in all regular texts.</Text>
  <Text skin="premium">
    Premium skin calls users to upgrade to get unlimited features.
  </Text>
  <Text skin="success">
    Success skin indicates that everything went smooth.
  </Text>
  <Text skin="error">Error skin alerts users that something went wrong.</Text>
  <Text skin="disabled">
    Disabled skin indicates that something cannot be accessed.
  </Text>
  <Text skin="primary">Primary skin is for inline links.</Text>
</StorybookComponents.Stack>;
```

#### Light

Invert text color so it can be used on a dark background with the `light` prop. It affects standard and disabled skins only.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text>Dark text is used on light backgrounds.</Text>
  <Box backgroundColor="D10">
    <Text light>Light text is used on dark backgrounds.</Text>
  </Box>
</StorybookComponents.Stack>;
```

#### Secondary

Emphasize content hierarchy by setting running text priority to `secondary`. It applies lower contrast font color for standard skin text only.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text skin="standard" secondary>
    Dark secondary text is used where it's less important than standard text.
  </Text>
  <Box backgroundColor="D10">
    <Text light secondary>
      Light secondary text also serves as neutral content just on a dark
      background.
    </Text>
  </Box>
</StorybookComponents.Stack>;
```

#### Unordered list

Use a standard `<ul>` HTML tag to build an unordered list. Control its style with the `listStyle` prop. It supports 2 styles:

- `checkmark`
- `circle`

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text listStyle="checkmark">
    The list below is built using standard "ul" and "li" HTML tags.
    <ul>
      <li>First statement</li>
      <li>
        Second statement
        <ul>
          <li>Subitem</li>
          <li>Subitem</li>
        </ul>
      </li>
      <li>Third statement</li>
    </ul>
  </Text>
  <Text listStyle="circle">
    The list below is built using standard "ul" and "li" HTML tags.
    <ul>
      <li>First statement</li>
      <li>
        Second statement
        <ul>
          <li>Subitem</li>
          <li>Subitem</li>
        </ul>
      </li>
      <li>Third statement</li>
    </ul>
  </Text>
</StorybookComponents.Stack>;
```

#### Ordered list

Use a standard `<ol>` HTML tag to build an ordered list. It accepts all default HTML [types](https://www.w3schools.com/html/html_lists_ordered.asp).

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Text>
    The list below is built using standard "ol" and "li" HTML tags.
    <ol type="1">
      <li>First statement</li>
      <li>
        Second statement
        <ol type="1">
          <li>Subitem</li>
          <li>Subitem</li>
        </ol>
      </li>
      <li>Third statement</li>
    </ol>
  </Text>
  <Text>
    The list below is built using standard "ol" and "li" HTML tags.
    <ol type="A">
      <li>First statement</li>
      <li>
        Second statement
        <ol type="a">
          <li>Subitem</li>
          <li>Subitem</li>
        </ol>
      </li>
      <li>Third statement</li>
    </ol>
  </Text>
  <Text>
    The list below is built using standard "ol" and "li" HTML tags.
    <ol type="I">
      <li>First statement</li>
      <li>
        Second statement
        <ol type="i">
          <li>Subitem</li>
          <li>Subitem</li>
        </ol>
      </li>
      <li>Third statement</li>
    </ol>
  </Text>
</StorybookComponents.Stack>;
```

#### Text overflow

Handle text overflow by wrapping text, truncating it or doing both.

By default, text wraps into any number of lines. With `ellipsis` enabled, it will truncate to fit the width of the parent container. Specify `maxLines` to truncate text after a specified number of rows.

Always provide full text content to view:

- The most accessible pattern is to add a 'Show more' button which expands the full text.
- Show full text on mouse hover with `showTooltip` prop. Control tooltip style by passing all default `<Tooltip/>` properties via `tooltipProps`.

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const suffixIcon = open ? <Icons.ChevronUp /> : <Icons.ChevronDown />;

  return (
    <StorybookComponents.Stack flexDirection="column" width="50%">
      <Text>Text that wraps forever. It doesn't show any ellipsis.</Text>
      <Box direction="vertical">
        <Text maxLines={open ? 4 : 2} ellipsis>
          Text that is truncated but has an accessible alternative to provide
          its full content. Click 'Show more' to expand full text. Full text is
          then revealed in the main layout.
        </Text>
        <TextButton onClick={() => setOpen(!open)} suffixIcon={suffixIcon}>
          {open ? 'Show less' : 'Show more'}
        </TextButton>
      </Box>
      <Text ellipsis maxLines={2}>
        Text with ellipsis. It can wrap until a specified number of lines. When
        the limit is reached it displays the 3 dot ellipsis. Full text is
        revealed on hover.
      </Text>
    </StorybookComponents.Stack>
  );
};
```

#### Custom tag

Render text as a custom HTML tag by using the `tagName` prop.

```jsx
<Text tagName="div">This text will be rendered as a "div" element.</Text>;
```

#### Inline link

Use a default `<a>` HTML tag to add an inline link to a sentence.

```jsx
<Text>
  Use a standard HTML 'a' tag to add <a>a text link</a> within the line.
</Text>;
```

### Common use case examples

#### Inline button

Use inline `<Box/>` to place buttons or other elements inline to text.

```jsx
<Text>
  Set up subscriptions, memberships or package plans to sell on your site.
  <Box inline paddingLeft="SP1">
    <TextButton underline="always">Learn more about Pricing Plans</TextButton>
  </Box>
</Text>;
```

#### Show more

Toggle `maxLines` prop value to recreate 'Show more / Show less' behavior for text paragraphs.

This is a more accessible way to handle text overflow than using a tooltip only, since keyboard users can't access the complete text inside the tooltip.

```jsx
() => {
  const [open, setOpen] = React.useState(false);
  const suffixIcon = open ? <Icons.ChevronUp /> : <Icons.ChevronDown />;

  return (
    <Box width="50%" direction="vertical">
      <Text maxLines={open ? 4 : 1} ellipsis>
        Click 'Show more' to display more than a single line of text. Toggling
        maxLines allows to recreate expand / collapse behaviour.
      </Text>
      <TextButton onClick={() => setOpen(!open)} suffixIcon={suffixIcon}>
        {open ? 'Show less' : 'Show more'}
      </TextButton>
    </Box>
  );
};
```

### Accessibility examples

#### Formatting

For better readability and accessibility:

- Use either `small` or `medium` text size for all running text.
- Keep text left-aligned (avoid center alignment, or don't overuse it).
- Avoid lines longer than 75 characters in any language.
- Divide long text into lists or short paragraphs.

```jsx
<StorybookComponents.Stack flexDirection="column">
  <Box gap="12px" direction="vertical">
    <Text weight="bold">Do:</Text>
    <Text>
      To ensure that text is easy to read:
      <ul>
        <li>Use font size that meets accessibility criteria.</li>
        <li>Divide text into shorter paragraphs or lists.</li>
        <li>Do not exceed 75 characters of line width in any language.</li>
        <li>Use left-alignment.</li>
      </ul>
    </Text>
  </Box>
  <Box gap="12px" direction="vertical">
    <Text weight="bold">Don't:</Text>
    <Text size="tiny">
      To ensure that text in a UI is easy to read, consider font size, paragraph
      length, line width, and text alignment. The font size should meet
      accessibility criteria, and the text should be divided into shorter
      paragraphs or lists. Line width should not exceed 75 characters in any
      language to enhance reading speed and comprehension. Lastly, text should
      be left-aligned, as center-aligned text is less readable.
    </Text>
  </Box>
</StorybookComponents.Stack>;
```

#### Contrast

All text should have a contrast ratio of at least 4.5:1, compared to its background.

For default running text:

- Use `standard` and `secondary` skins on white and light backgrounds.
- Use `light` and `light` `secondary` on dark backgrounds.

```jsx
<StorybookComponents.Stack flexDirection="column" gap="0px">
  <Box direction="vertical" padding="12px" backgroundColor="D80">
    <Text>Standard skin on white background.</Text>
    <Text secondary>Standard secondary skin on white background.</Text>
  </Box>
  <Box direction="vertical" padding="12px" backgroundColor="D10">
    <Text light>Light skin on dark background.</Text>
    <Text light secondary>
      Light secondary skin on dark background.
    </Text>
  </Box>
</StorybookComponents.Stack>;
```

## Code

```jsx
import { Text } from '@wix/design-system';
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `appendTo` | `null \| Element \| "window" \| "scrollParent" \| "viewport" \| "parent" \| Predicate` | — |  |
| `children` | `ReactNode` | — | Renders any kind of content within a heading. Usually it's a text string. |
| `className` | `string` | — |  |
| `dataHook` | `string` | — | Applies a data-hook HTML attribute that can be used in the tests. |
| `disabled` | `boolean` | — |  |
| `ellipsis` | `boolean` | — | When true, text that is longer than it's container will be truncated to a single line followed by ellipsis. Otherwise the text will break into several lines. |
| `enterDelay` | `number` | — |  |
| `exitDelay` | `number` | — |  |
| `fixed` | `boolean` | — |  |
| `flip` | `boolean` | — |  |
| `id` | `string` | — | Applies id HTML attribute. |
| `interactive` | `boolean` | — |  |
| `light` | `boolean` | — | Inverts text color so it can be used on dark backgrounds. |
| `listStyle` | `"circle" \| "checkmark"` | — | Sets list items style. |
| `maxLines` | `number` | — | maxLines truncates text at a specific number of lines. |
| `maxWidth` | `string \| number \| string & {}` | — |  |
| `moveArrowTo` | `number` | — |  |
| `moveBy` | `Partial<{ x: number; y: number; }>` | — |  |
| `onClick` | `MouseEventHandler` | — | Defines a callback function which is called when the text is clicked. |
| `onEllipsisStateChange` | `(isActive: boolean) => void` | — | A callback fired when ellipsis state changes. |
| `onHide` | `() => void` | — |  |
| `onShow` | `() => void` | — |  |
| `overflowWrap` | `"normal" \| "break-word" \| "anywhere"` | — | Sets "overflow-wrap" CSS property. Controls how text will behave upon overflowing parent component. |
| `placement` | `"right" \| "left" \| "top" \| "bottom" \| "auto" \| "auto-start" \| "auto-end" \| "top-start" \| "top-end" \| "right-start" \| "right-end" \| "bottom-end" \| "bottom-start" \| "left-end" \| "left-start"` | — |  |
| `secondary` | `boolean` | — | Sets text type to secondary. Affects font color only. |
| `showTooltip` | `boolean` | `true` | Shows a tooltip with the full text when the text is truncated. |
| `size` | `"small" \| "tiny" \| "medium"` | — | Controls the font size of the text. |
| `skin` | `"disabled" \| "error" \| "standard" \| "premium" \| "primary" \| "success"` | — | Controls the skin of the text. |
| `tagName` | `string` | — | Defines a tag name that text should be rendered inside of (e.g., div, a, p). |
| `textAlign` | `"center" \| "start"` | — |  |
| `tooltipProps` | `TooltipCommonProps` | — | Allows to pass all common tooltip props. |
| `weight` | `"bold" \| "normal" \| "thin"` | — | Controls the font weight of the text. |
| `widows` | `boolean` | — | if true it will support widows in the text. |
| `zIndex` | `string & {} \| "-moz-initial" \| "inherit" \| "initial" \| "revert" \| "revert-layer" \| "unset" \| "auto" \| number & {}` | — |  |

## Testkit

Import the driver matching your test environment:

```jsx
// UniDriver
import { TextUniDriver } from '@wix/design-system/dist/testkit/unidriver';

// Vanilla
import { TextTestkit } from '@wix/design-system/dist/testkit';

// Puppeteer
import { TextTestkit } from '@wix/design-system/dist/testkit/puppeteer';

// Testing Library
import { TextTestkit } from '@wix/design-system/dist/testkit/testing-library';
```

### Driver methods

| Method | Description |
| --- | --- |
| `getTagName` | Get the root element's tagName |
| `getText` | Get text content (innerHTML) |
| `getSize` | Get size |
| `getSkin` | Get skin |
| `getWeight` | Get weight |
| `getId` | Get id |
| `isLight` | Is light |
| `isSecondary` | Is secondary |
| `isMasked` | Checks if component has masking classNames |
| `isWidows` | Checks if the text is using &nbsp; |
| `exists` | Checks whether the component found with the given data hook. |
| `element` | Gets the component root element. |
| `click` | Clicks on the component root element. |
| `base` | Returns UniDriver for the base element. |

## Changelog

- **1.340.0** (2026-10-21) — maintenance release, no component-specific changes
- **1.339.0** (2026-10-19) — maintenance release, no component-specific changes
- **1.338.0** (2026-10-15) — maintenance release, no component-specific changes
- **1.330.0** (2026-09-28) — maintenance release, no component-specific changes
- **1.329.0** (2026-09-24) — maintenance release, no component-specific changes
- **1.325.0** (2026-09-17) — maintenance release, no component-specific changes
- **1.310.0** (2026-08-10) — maintenance release, no component-specific changes
- **1.292.0** (2026-06-22) — maintenance release, no component-specific changes
- **1.291.0** (2026-06-19) — maintenance release, no component-specific changes
- **1.278.0** (2026-05-08) — maintenance release, no component-specific changes
- **1.273.0** (2026-04-30) — maintenance release, no component-specific changes
- **1.266.0** (2026-04-07) — maintenance release, no component-specific changes
- **1.260.0** (2026-03-17) — maintenance release, no component-specific changes
- **1.250.0** (2026-01-27) — maintenance release, no component-specific changes
- **1.212.0** (2025-08-11) — maintenance release, no component-specific changes
- **1.138.1** (2024-10-30) — maintenance release, no component-specific changes
- **1.129.0** (2024-09-25) — maintenance release, no component-specific changes
- **1.121.0** (2024-08-13) — feat: add overflowWrap property ([#14031](invalid-url))
- **1.116.0** (2024-07-22) — feat: add onEllipsisStateChange callback ([#13963](invalid-url))
- **1.115.0** (2024-07-17) — maintenance release, no component-specific changes
- **1.109.2** (2024-06-17) — fix: fix typescript and proptypes clash ([#13840](invalid-url))
- **1.103.3** (2024-04-30) — maintenance release, no component-specific changes
- **1.102.0** (2024-04-16) — maintenance release, no component-specific changes
- **1.101.0** (2024-04-12) — maintenance release, no component-specific changes
- **1.100.0** (2024-04-04) — maintenance release, no component-specific changes
- **1.98.0** (2024-03-15) — maintenance release, no component-specific changes
- **1.95.1** (2024-02-19) — maintenance release, no component-specific changes
- **1.92.1** (2024-02-05) — maintenance release, no component-specific changes