ControlsNew
Glass Textarea
A recessed glass text area that can grow with its text.
Preview
Demos ready. Update 0.
The preview runs the React version. On iOS 26 and later, the React Native version uses the system’s own glass. See it on a phone.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-textareaAdds 6 files to components/glassyui and installs clsx.
Usage
Usage
import { GlassTextarea } from "@/components/glassyui/glass-textarea";
export function MessageDemo() {
return <GlassTextarea autoResize label="Message" hint="Grows as you type." placeholder="Say hello…" />;
}React Native usage
import { useState } from 'react';
import { GlassTextarea } from '@/components/glassyui/glass-textarea';
export default function TextareaExample() {
const [notes, setNotes] = useState('');
return (
<GlassTextarea
label="Notes"
maxRows={6}
onChangeText={setNotes}
placeholder="Add a note"
value={notes}
/>
);
}
Examples
Limit the growth
<GlassTextarea autoResize maxRows={5} label="Notes" />Fixed height with a resize handle
<GlassTextarea rows={6} label="Bio" />API reference
GlassTextarea
A textarea in a wrapper with its label and hint. className and ref go to the textarea.
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | None | Visible label above the field, linked with htmlFor. |
hint | string | None | Helper text below the field, linked with aria-describedby. |
rows | number | 3 | Starting height in rows. Without autoResize the field has a vertical resize handle. |
autoResize | boolean | false | Grows with its text, refitting when the width changes, then scrolls past maxRows. |
maxRows | number | 8 | The most rows an auto-resizing field grows to. |
Also accepts HTML textarea attributes.
- Types
GlassTextareaProps- Accessibility
- Without a label, name the field with aria-label.
The React Native props and exports are in the component’s source.