---
name: "text"
mode: "component"
versionRequirements:
  - { name: "Base Library", version: "2.10.0" }
title: "text - Text"
---

## text

> [VERSION] Base Library >= 2.10.0

### Description

Text component for displaying text, with features like text selection.

### Props

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `user-select` | `boolean` | No | `false` | Whether the text is selectable |

### Examples

#### Basic usage

*index.tyml*

```xml
// index.tyml
<view class="section">
  <text>This is plain text</text>
  <text user-select="{{true}}">Long-press to select and copy this text</text>
  <text>First line\nSecond line</text>
  <text>Sold {{count}} units</text>
</view>
```

*index.tyss*

```css
.section {
  padding: 20rpx;
}
.section text {
  display: block;
  font-size: 28rpx;
  color: #333;
  margin-bottom: 16rpx;
}
```

*index.js*

```javascript
Page({
  data: {
    count: 128,
  },
});
```
