Duostrap Textarea
A multiline text input styled with archived Duostrap field visuals and classic validation states over Base Textarea.
Duostrap Textarea applies archived Duostrap field styling (4px radius, inset shadow, #52a8ec focus glow, and #eee disabled fill) to Base Textarea, rendering a single native multiline editor on the Web while preserving the classic light palette in dark hosts.
Preview
Section titled “Preview”<wc-duostrap-textarea-root
placeholder="Type your message here."
aria-label="Message"
rows="4"
></wc-duostrap-textarea-root>Installation
Section titled “Installation”Available from workspace source via @proto.ui/prototypes-duostrap/textarea (and @proto.ui/prototypes-duostrap/field for form composition). Browse the implemented subset.
import { DuostrapTextareaRoot } from '../proto-ui/components/react';<DuostrapTextareaRoot placeholder="Type your message here." rows={4} />- Values and events: Supports controlled
valueand uncontrolleddefaultValue, normalizedvalueChange,change, and IME composition events, plusresetValue(),focusSelf(), andblurSelf(). - Rows and wrapping: Configure
rowsandwrapto control visible lines and wrapping behavior; ships with a 64px minimum height and vertical resize (resize-y). - Field composition: Pair
FieldTextareawithField,FieldLabel,FieldDescription, andFieldErrorfor accessible associations and classic#953b39/#d59392error styling.
Examples
Section titled “Examples”Compose Field, FieldLabel, FieldTextarea, and FieldDescription for a classic Bootstrap form block.
<wc-duostrap-field-root>
<wc-duostrap-field-label>Message</wc-duostrap-field-label>
<wc-duostrap-field-textarea
placeholder="Type your message here."
rows="4"
></wc-duostrap-field-textarea>
<wc-duostrap-field-description>
Enter your message below.
</wc-duostrap-field-description>
</wc-duostrap-field-root>Disabled
Section titled “Disabled”Disabled textareas display the classic #eee background fill and not-allowed cursor.
<wc-duostrap-field-root disabled>
<wc-duostrap-field-label>Message</wc-duostrap-field-label>
<wc-duostrap-field-textarea
placeholder="Type your message here."
rows="3"
></wc-duostrap-field-textarea>
</wc-duostrap-field-root>Invalid
Section titled “Invalid”Pass invalid and errors to Field to activate Duostrap’s #953b39 error border and #d59392 focus glow.
<wc-duostrap-field-root invalid>
<wc-duostrap-field-label>Message</wc-duostrap-field-label>
<wc-duostrap-field-textarea
placeholder="Type your message here."
rows="3"
></wc-duostrap-field-textarea>
<wc-duostrap-field-error></wc-duostrap-field-error>
</wc-duostrap-field-root>Button
Section titled “Button”Pair with a classic Duostrap submit button.
<div class="flex flex-col items-start gap-2">
<wc-duostrap-textarea-root
placeholder="Type your message here."
aria-label="Message"
rows="3"
></wc-duostrap-textarea-root>
<wc-duostrap-button>Send message</wc-duostrap-button>
</div>The following props belong to Root (pass value for controlled mode; minLength and maxLength default to -1 when unlimited):
| Prop | Type | Default |
|---|---|---|
value | string undefined | uncontrolled |
defaultValue | string | '' |
disabled | boolean | false |
readOnly | boolean | false |
placeholder | string | '' |
rows | number | 2 |
required | boolean | false |
name | string | '' |
autoComplete | string | '' |
minLength | number | -1 |
maxLength | number | -1 |
wrap | 'soft' 'hard' | 'soft' |
ariaLabel | string | '' |
labelledBy | string | '' |
describedBy | string | '' |
- Exposed states:
value,disabled,readOnly,focused,focusVisible,composing(plusinvalidandpendingonFieldTextarea). - Exposed methods:
focusSelf(options?),blurSelf(),resetValue(). - Events:
valueChange,change,compositionStart,compositionUpdate,compositionEnd.