Liquid Glass Textarea
A legible opaque content-layer multiline text editor with concentric rounded geometry designed to pair cleanly with Liquid Glass controls.
Liquid Glass Textarea follows the Apple Liquid Glass Human Interface Guidelines separation between the opaque Content Layer and floating Liquid Glass controls: the editor renders on a high-legibility opaque surface (bg-background, rounded-2xl, crisp border) without applying translucent glass directly onto editable text, pairing cleanly with prominent Liquid Glass action buttons.
Preview
Section titled “Preview”<div class="grid gap-3 rounded-3xl p-6">
<wc-liquid-glass-label-root>Message</wc-liquid-glass-label-root>
<wc-liquid-glass-textarea-root
placeholder="Type your message here."
rows="4"
></wc-liquid-glass-textarea-root>
</div>Installation
Section titled “Installation”Available from workspace source via @proto.ui/prototypes-liquid-glass/textarea (and @proto.ui/prototypes-liquid-glass/field for form composition).
import { LiquidGlassTextareaRoot } from '../proto-ui/components/react';<LiquidGlassTextareaRoot placeholder="Type your message here." rows={4} />- Content Layer hierarchy: Text editing stays on an opaque, readable surface rather than stacking glass on content; pairing the editor’s
rounded-2xlgeometry inside arounded-3xlcontainer preserves concentric corner radii. - Accessibility and state styling: Keyboard focus shows a
forced-colors-aware outer focus ring; disabled state uses semanticbg-mutedandtext-muted-foregroundfills rather than lowering element opacity so fallback contrast stays readable; invalid state renders a semantic destructive border and halo viaFieldTextarea. - Inherited semantics: Controlled/uncontrolled values, IME composition events,
resetValue(),focusSelf(), andblurSelf()are owned by Base Textarea.
Examples
Section titled “Examples”Compose Field, FieldLabel, FieldDescription, and FieldTextarea for accessible labeling and helper text.
<wc-liquid-glass-field-root>
<wc-liquid-glass-field-label>Message</wc-liquid-glass-field-label>
<wc-liquid-glass-field-description>
Enter your message below.
</wc-liquid-glass-field-description>
<wc-liquid-glass-field-textarea
placeholder="Type your message here."
rows="4"
></wc-liquid-glass-field-textarea>
</wc-liquid-glass-field-root>Disabled
Section titled “Disabled”Disabled editors switch to a muted background and foreground pair while preserving contrast without opacity drop.
<wc-liquid-glass-field-root disabled>
<wc-liquid-glass-field-label>Message</wc-liquid-glass-field-label>
<wc-liquid-glass-field-textarea
default-value="This message is archived and cannot be edited."
rows="3"
></wc-liquid-glass-field-textarea>
</wc-liquid-glass-field-root>Invalid
Section titled “Invalid”Pass invalid and errors to Field to display semantic destructive border/ring styling and an accessible error message.
<wc-liquid-glass-field-root invalid>
<wc-liquid-glass-field-label>Message</wc-liquid-glass-field-label>
<wc-liquid-glass-field-textarea
placeholder="Type your message here."
rows="3"
></wc-liquid-glass-field-textarea>
<wc-liquid-glass-field-error></wc-liquid-glass-field-error>
</wc-liquid-glass-field-root>Button
Section titled “Button”Pair the opaque content-layer Textarea with regular and prominent Liquid Glass action buttons to demonstrate clear content-vs-control layering without glass-on-glass stacking.
<div class="grid gap-4 rounded-3xl p-6">
<wc-liquid-glass-textarea-root
placeholder="Type your message here."
aria-label="Message"
rows="3"
></wc-liquid-glass-textarea-root>
<div class="flex justify-end gap-3">
<wc-liquid-glass-button variant="regular">
Cancel
</wc-liquid-glass-button>
<wc-liquid-glass-button variant="prominent">
Send message
</wc-liquid-glass-button>
</div>
</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.