Text Input
A single-line text input for short free-form responses such as names, titles, or short answers.
Overview
The Text Input field renders a standard HTML input[type=text] element. It is the most general-purpose field and is suitable for any short, unformatted text response. For longer text, use the Textarea field. For structured text like email addresses or phone numbers, use the dedicated field types which add appropriate validation.
Text Input supports minimum and maximum length validation, regex pattern matching, and custom error messages. It also supports a default value and a placeholder hint.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| type | string | — | The field type identifier (e.g. "text", "email"). |
| label | string | — | Human-readable label shown above the field. |
| name | string | — | Unique machine name used as the data key in submissions. |
| required | boolean | false | When true the form cannot be submitted without a value. |
| placeholder | string | undefined | Ghost text shown inside the input when empty. |
| defaultValue | any | undefined | Pre-filled value when the form loads. |
| hidden | boolean | false | Hides the field from the rendered form (still submitted). |
| disabled | boolean | false | Renders the field as read-only and non-interactive. |
| description | string | undefined | Helper text displayed below the field label. |
| className | string | undefined | Additional CSS class applied to the field wrapper. |
| validation.minLength | number | undefined | Minimum number of characters required. |
| validation.maxLength | number | undefined | Maximum number of characters allowed. |
| validation.pattern | string | undefined | A regex pattern the value must match. |
| validation.patternMessage | string | undefined | Custom message shown when the pattern does not match. |
JSON Schema
{
"type": "text",
"label": "Full Name",
"name": "full_name",
"required": true,
"placeholder": "Enter your full name",
"description": "As it appears on your ID",
"validation": {
"minLength": 2,
"maxLength": 100
}
}Common Use Cases
- First name, last name, or full name fields
- Job title or company name
- Street address line 1 / line 2
- Short answer survey questions
- Product or event names in administrative forms
