Textarea
A multi-line form control that can grow with its content.
Installation
Import from the Reflow workspace package.
Playground
Open demoimport { Textarea } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Textarea name="notes" aria-label="Notes" autoResize />
</>
)
}With Field
import { Field, Textarea } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Field label="Message" description="Tell us what you have in mind.">
{(control) => <Textarea {...control} rows={3} />}
</Field>
</>
)
}Invalid
import { Field, Textarea } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Field label="Bio" error="Write at least 20 characters">
{(control) => <Textarea {...control} defaultValue="Hi" />}
</Field>
</>
)
}Disabled
import { Textarea } from '@rtzll/reflow'
import { type Handle } from 'remix/component'
export function Example(handle: Handle) {
return () => (
<>
<Textarea aria-label="Message" defaultValue="You can't edit this message." disabled />
</>
)
}API Reference
Public props for the Reflow implementation. Native controls also accept their standard HTML attributes and Remix event mixes.
Textarea
| Prop | Type | Default | Description |
|---|---|---|---|
children | undefined | — | Textarea content comes from `value` or `defaultValue`. |
disabled | boolean | — | The `disabled` HTML attribute. |
name | string | — | The `name` HTML attribute. |
value | string | number | — | The `value` HTML attribute. |
defaultValue | string | number | — | The `defaultValue` HTML attribute. |
placeholder | string | — | The `placeholder` HTML attribute. |
required | boolean | — | The `required` HTML attribute. |
rows | number | 3 | The `rows` HTML attribute. |
size | "default" | "compact" | — | Control density or icon-button dimensions. |
autoResize | boolean | true | Grows the textarea with its contents. |