---
title: Text 文本
---

# Text 文本

Used for text.

## Basic

:::example Use the `type` attribute to define Text's type.

text/basic

:::

## Sizes

:::example Use attribute `size` to set additional sizes with `large`, `default` or `small`.

text/sizes

:::

## Ellipsis

:::example Pass the `truncated` prop to render an ellipsis when the text exceeds the width of the viewport or max-width set. `line-clamp` prop to render multiline ellipsis.

text/truncated

:::

## Override

:::example Use attribute `tag` to override element

text/override

:::

## Mixed

:::example Text mixed component

text/mixed

:::

## API

### Attributes

| Name                | Description        | Type                                                               | Default |
| ------------------- | ------------------ | ------------------------------------------------------------------ | ------- |
| type                | text type          | ^[enum]`'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'` | —       |
| size                | text size          | ^[enum]`'large' \| 'default' \| 'small'`                           | default |
| truncated           | render ellipsis    | ^[boolean]                                                         | false   |
| line-clamp ^(2.4.0) | maximum lines      | ^[string] / ^[number]                                              | —       |
| tag                 | custom element tag | ^[string]                                                          | span    |

### Slots

| Name    | Description     |
| ------- | --------------- |
| default | default content |
