A2TextField
Form field component with label and input.
Props
| Property | Type | Default | Description |
|---|---|---|---|
label | string | - | Field label |
prop | string | - | Form data key |
placeholder | string | - | Input placeholder |
variant | `shortText | longText` | shortText |
rows | number | 4 | Rows for longText variant |
disabled | boolean | false | Disabled state |
required | boolean | false | Required field |
Default Value (Flat Format)
In flat format, you can set an initial default value using value.default:
json
{
"id": "nameField",
"component": "TextField",
"label": "Name",
"value": { "path": "/form/name", "default": "John Doe" }
}Basic Example
Long Text Example
Required Field Example
Form Example
JSON Schema
json
{
"id": "textFieldId",
"type": "a2-text-field",
"props": {
"label": "Field Label",
"prop": "fieldName",
"placeholder": "Enter value...",
"variant": "shortText",
"required": false
}
}