> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# text-area

多行文本输入组件，支持自动高度、字数限制等功能。

<iframe src="https://developer.doubao.com/docs-preview/component-simulator/?caseId=textarea"
  title="组件示例 text-area"
  width="100%"
  height="700"
  loading="lazy"
  style="width:100%;height:700px;border:0;border-radius:16px;overflow:hidden;"
></iframe>

## 扫码预览

![扫码预览 text-area](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fcomponent%252Ftextarea%252Findex)

## Props

<table>
<thead>
<tr><th width="140">属性名</th><th width="240">类型</th><th width="120">默认值</th><th width="80">必填</th><th width="360">说明</th></tr>
</thead>
<tbody>
<tr><td>bounces</td><td><code>boolean</code></td><td>true</td><td>否</td><td>iOS 弹性效果</td></tr>
<tr><td>className</td><td><code>string</code></td><td>-</td><td>否</td><td>组件类名</td></tr>
<tr><td>confirmType</td><td><code>&quot;search&quot; | &quot;next&quot; | &quot;send&quot; | &quot;go&quot; | &quot;done&quot;</code></td><td>'done'</td><td>否</td><td>键盘右下角确认按钮的类型</td></tr>
<tr><td>disabled</td><td><code>boolean</code></td><td>false</td><td>否</td><td>是否禁用</td></tr>
<tr><td>id</td><td><code>string</code></td><td>-</td><td>否</td><td>元素的唯一标识</td></tr>
<tr><td>key</td><td><code>string | number | null</code></td><td>-</td><td>否</td><td>React key 属性</td></tr>
<tr><td>lineSpacing</td><td><code>number | `${number}px` | `${number}rpx`</code></td><td>-</td><td>否</td><td>行间距</td></tr>
<tr><td>maxlength</td><td><code>number</code></td><td>140</td><td>否</td><td>最大输入长度</td></tr>
<tr><td>maxlines</td><td><code>number</code></td><td>-</td><td>否</td><td>最大行数</td></tr>
<tr><td>onBlur</td><td><code>(event: BaseEvent&lt;&quot;bindblur&quot;, TextAreaBlurEvent&gt;) =&gt; void</code></td><td>-</td><td>否</td><td>失焦时触发</td></tr>
<tr><td>onConfirm</td><td><code>(event: BaseEvent&lt;&quot;bindconfirm&quot;, TextAreaConfirmEvent&gt;) =&gt; void</code></td><td>-</td><td>否</td><td>点击键盘确认按钮时触发</td></tr>
<tr><td>onFocus</td><td><code>(event: BaseEvent&lt;&quot;bindfocus&quot;, TextAreaFocusEvent&gt;) =&gt; void</code></td><td>-</td><td>否</td><td>聚焦时触发</td></tr>
<tr><td>onInput</td><td><code>(event: BaseEvent&lt;&quot;bindinput&quot;, TextAreaInputEvent&gt;) =&gt; void</code></td><td>-</td><td>否</td><td>输入内容变化时触发</td></tr>
<tr><td>onSelectionChange</td><td><code>(event: BaseEvent&lt;&quot;bindselection&quot;, TextAreaSelectionChangeEvent&gt;) =&gt; void</code></td><td>-</td><td>否</td><td>选择区域变化时触发</td></tr>
<tr><td>placeholder</td><td><code>string</code></td><td>-</td><td>否</td><td>占位符文本</td></tr>
<tr><td>readonly</td><td><code>boolean</code></td><td>false</td><td>否</td><td>是否只读</td></tr>
<tr><td>ref</td><td><code>Ref&lt;NodesRef&gt;</code></td><td>-</td><td>否</td><td>用于获取组件实例的 ref</td></tr>
<tr><td>showSoftInputOnFocus</td><td><code>boolean</code></td><td>true</td><td>否</td><td>聚焦时是否显示软键盘</td></tr>
<tr><td>style</td><td><code>CSSProperties</code></td><td>-</td><td>否</td><td>组件样式</td></tr>
</tbody>
</table>
