Skip to content

Input Element ​

The live input field is the standard single-line field for text, numbers, dates, email, passwords, and similar browser input types.

Common Configuration Properties ​

PropertyTypeDescription
typeStringMust be "input"
labelStringField label
modelStringModel key that stores the value
placeholderStringPlaceholder text
disabledBooleanDisables the field
readonlyBooleanMakes the field read-only
requiredBooleanMarks the field as required
styleClassesString / ArrayCSS classes for the field wrapper
fieldOptionsObjectV3+ input configuration, including inputType and standard input attributes

fieldOptions ​

The live V3+ field reads its HTML input configuration from fieldOptions.

Common keys include:

KeyTypeDescription
inputTypeStringBrowser input type such as text, password, email, number, url, tel, date, datetime-local, color, or range
autocompleteStringBrowser autocomplete mode
minNumber / StringMinimum value for numeric/date-like inputs
maxNumber / StringMaximum value for numeric/date-like inputs
stepNumber / StringStep increment for numeric/range inputs
maxlengthNumberMaximum length for text-like inputs
minlengthNumberMinimum length for text-like inputs
patternStringHTML input pattern
acceptStringAccepted file types when using file-style inputs

Example Schema Snippet ​

json
{
  "type": "input",
  "label": "Full Name",
  "model": "fullName",
  "placeholder": "Enter your full name",
  "required": true,
  "hint": "Please provide your first and last name.",
  "fieldOptions": {
    "inputType": "text",
    "maxlength": 100
  }
}

Number Input Example ​

json
{
  "type": "input",
  "label": "Quantity",
  "model": "itemQuantity",
  "default": 1,
  "hint": "Enter a number between 1 and 100.",
  "fieldOptions": {
    "inputType": "number",
    "min": 1,
    "max": 100,
    "step": 1
  }
}

Runtime Notes ​

  • fieldOptions.inputType is the canonical V3+ shape. BetterForms can migrate legacy top-level inputType, but docs should prefer fieldOptions.
  • For number and range, the field parses user input into numeric values.
  • For date, datetime, and datetime-local, the field applies date parsing and formatting logic before writing back to the model.
  • If schema.format is supplied for date-like input types, it is used when formatting the stored value.

Full Property Reference ​

This element is implemented in the sibling vue-form-generator source as fieldInput.vue.

Klai Studio documentation