shadcn_ui-textarea

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shadcn UI — Textarea

Shadcn UI — 文本区域

Instructions

说明

ShadTextarea
displays a multi-line form field or textarea-like component. Use
placeholder
and optional
initialValue
. For forms use
ShadTextareaFormField
with
id
,
label
,
placeholder
,
description
, and
validator
.
ShadTextarea
是一个多行表单字段类组件,类似文本区域。可使用
placeholder
和可选的
initialValue
属性。在表单中使用
ShadTextareaFormField
时,可配置
id
label
placeholder
description
validator
属性。

Standalone

独立使用

dart
const ShadTextarea(
  placeholder: Text('Type your message here'),
)
dart
const ShadTextarea(
  placeholder: Text('Type your message here'),
)

Form field

表单字段

dart
ShadTextareaFormField(
  id: 'bio',
  label: const Text('Bio'),
  placeholder: const Text('Tell us a little bit about yourself'),
  description: const Text(
    'You can @mention other users and organizations.'),
  validator: (v) {
    if (v.length < 10) return 'Bio must be at least 10 characters.';
    return null;
  },
)
dart
ShadTextareaFormField(
  id: 'bio',
  label: const Text('Bio'),
  placeholder: const Text('Tell us a little bit about yourself'),
  description: const Text(
    'You can @mention other users and organizations.'),
  validator: (v) {
    if (v.length < 10) return 'Bio must be at least 10 characters.';
    return null;
  },
)