Text input

Text input is the default field type which is used if the specified field type does not match the other available fields. It will display the standard input field.

The most straightforward text input field syntax is as follows:

{
    "name": "fieldName",
    "label": "Field name",
    "group": "Group name",
    "value": "default value",
    "type": "text",
    "disabled": false
}
Text Input

If you will use a type value which does not match other fields types, that value will be used as a type attribute in the rendered input HTML element.

That allows you to create fields like "number", "hidden", "email", "www" etc.

Custom parameters

The text input field supports few other parameters compliant with the HTML input element syntax:

  • min
  • max
  • size
  • step
  • pattern
  • placeholder

Also, there is available an additional parameter that allows creating a short description of the text input field:

  • note

Example:

{
    "name": "pageWidth",
    "label": "Page width",
    "group": "Layout",
    "value": "63rem",
    "note": "Use of โ€žremโ€ units recommended; also use others (px, vw)",
    "type": "text"
}
Text input

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide