# TextField A form control for single-line or multi-line text input. ## Usage Use standalone. ```svelte ``` ## Anatomy The `class` attribute values represent part names, and `conditional` indicates elements that are rendered conditionally. Other attributes represent their corresponding props. ```svelte
{aux}
{left} {#if type === "textarea"} {:else} {#each options as option} {/each} {/if} {right}
{bottom}
``` ## Props | Name | Type | Default | Description | | ------------- | --------------------- | --------- | ------------------------------------------------------------------------- | | `label` | `string` | - | Field label | | `extra` | `string` | - | Extra text shown with the label | | `aux` | `Snippet` | - | Auxiliary content; receives value, variant, and control element | | `left` | `Snippet` | - | Content before the control; receives value, variant, and control element | | `right` | `Snippet` | - | Content after the control; receives value, variant, and control element | | `bottom` | `string` | - | Bottom message | | `reserve` | `boolean` | `false` | Renders the bottom element even without a message to prevent layout shift | | `value` | `string` | - | Bindable field value | | `type` | `` | `"text"` | Control type, including textarea mode | | `options` | `SvelteSet` | - | String datalist suggestions; ignored when `type` is `"textarea"` | | `validations` | `TextFieldValidation` | - | Validation functions for input values | | `attach` | `Attachment` | - | Svelte attachment on the control | | `element` | `HTMLInputElement` | - | Bindable control element | | `styling` | `SVSClass` | - | Styling override | | `variant` | `SVSVariant` | `NEUTRAL` | Bindable variant | | `cols` | `number` | - | Textarea column count | | `rows` | `number` | - | Textarea row count | | `wrap` | `` | - | Textarea wrapping behavior | Other `HTMLInputAttributes` are passed to ``/`