Textarea
A native textarea element that automatically works with Field.
Usage guidelines
- Form controls must have an accessible name: It can be created using a
<label>element or theFieldcomponent. See the forms guide.
Anatomy
Import the component and use it as a single part:
In a SvelteKit remote form, spread a field’s as('text') props onto it. TypeScript rejects the props of any other input type, because a textarea has no type.
API reference
defaultValue string | null —
- Name
- Description
The value an empty
valuestarts from, and the value a form reset restores.- Type
string | null
value string | null —
- Name
- Description
The value of the textarea.
- Type
string | null- Binding
bind:value
render Snippet<[props: HTMLTextareaAttributes, state: TextareaState, children: Snippet | undefined]> —
- Name
- Description
Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a snippet that receives the props to spread onto the element, the component's state, and the children to render.
- Type
Snippet<[props: HTMLTextareaAttributes, state: TextareaState, children: Snippet | undefined]>
disabled boolean
- Name
disabled- Description
Whether the component should ignore user interaction.
- Type
boolean
touched boolean
- Name
touched- Description
Whether the field has been touched.
- Type
boolean
dirty boolean
- Name
dirty- Description
Whether the field value has changed from its initial value.
- Type
boolean
valid boolean | null
- Name
valid- Description
Whether the field is valid.
nullmeans validity is not known yet.- Type
boolean | null
filled boolean
- Name
filled- Description
Whether the field has a value.
- Type
boolean
focused boolean
- Name
focused- Description
Whether the field is focused.
- Type
boolean