Admin-side forms can be created with a variety of fields. This document provides a complete reference of the properties of each field, and provides usage examples.
Admin-side forms can be created with a variety of fields. This document provides a complete reference of the properties of each field, and provides usage examples.
In addition to the fields listed below, reserved for usage in the Admin, you can also use all the fields available in the frontend forms described in [the Frontend Forms Fields Reference](/forms/forms/fields-available).
In addition to the fields listed below, reserved for usage in the Admin, you can also use all the fields available in the frontend forms described in [the Frontend Forms Fields Reference](/forms/forms/fields-available).
### Special Form Fields Available Exclusively in the Admin
### Special Form Fields Available Exclusively in the Admin
[div class="table table-keycol"]
<div class="table table-keycol">
| Field | Description |
| Field | Description |
| :----- | :----- |
| :----- | :----- |
| **[Array](#the-array-field)** | used to create key-value arrays |
| **[Array](#the-array-field)** | used to create key-value arrays |
| **BackupHistory** | |
| **BackupHistory** | |
| **Blueprint** | |
| **Blueprint** | |
| **[Colorpicker](#the-colorpicker-field)** | show a color picker |
| **[Colorpicker](#the-colorpicker-field)** | show a color picker |
| **[Columns](#the-columns-column-fields)** | used to break the form into multiple columns |
| **[Columns](#the-columns-column-fields)** | used to break the form into multiple columns |
| **[Column](#the-columns-column-fields)** | used to show a single column (used with the `Columns` field) |
| **[Column](#the-columns-column-fields)** | used to show a single column (used with the `Columns` field) |
| **Cron** | |
| **Cron** | |
| **CronStatus** | |
| **CronStatus** | |
| **[Dateformat](#the-dateformat-field)** | a special select that renders the current date/time in the passed formats |
| **[Dateformat](#the-dateformat-field)** | a special select that renders the current date/time in the passed formats |
| **[Datetime](#the-datetime-field)** | a date and time selection field |
| **[Datetime](#the-datetime-field)** | a date and time selection field |
| **[Editor](#the-editor-field)** | show a markdown editor |
| **[Editor](#the-editor-field)** | show a markdown editor |
| **[Fieldset](#the-fieldset-field)** | group a set of fields inside a collapsible accordion |
| **[Fieldset](#the-fieldset-field)** | group a set of fields inside a collapsible accordion |
| **[File](#the-file-field)** | in Admin, **File** is specialized to be used in plugin and theme configurations (blueprints). Handles uploading a file to a location and deleting it, and removing it from the theme / plugin configuration |
| **[File](#the-file-field)** | in Admin, **File** is specialized to be used in plugin and theme configurations (blueprints). Handles uploading a file to a location and deleting it, and removing it from the theme / plugin configuration |
| **[Filepicker](#the-filepicker-field)** | **Filepicker** allows to choose files from a location in the web server filesystem. |
| **[Filepicker](#the-filepicker-field)** | **Filepicker** allows to choose files from a location in the web server filesystem. |
| **Frontmatter** | |
| **Frontmatter** | |
| **IconPicker** | |
| **IconPicker** | |
| **[List](#the-list-field)** | used to create collections of fields |
| **[List](#the-list-field)** | used to create collections of fields |
| **Markdown** | |
| **Markdown** | |
| **MediaPicker** | |
| **MediaPicker** | |
| **Multilevel** | |
| **Multilevel** | |
| **Order** | |
| **Order** | |
| **PageMedia** | |
| **PageMedia** | |
| **[PageMediaSelect](#the-pagemediaselect-field)** | shows a select with all the page media. Used in Pages blueprints to let the user choose a media file to be assigned to a field. |
| **[PageMediaSelect](#the-pagemediaselect-field)** | shows a select with all the page media. Used in Pages blueprints to let the user choose a media file to be assigned to a field. |
| **[Pages](#the-pages-field)** | shows a list of the site pages |
| **[Pages](#the-pages-field)** | shows a list of the site pages |
| **Parents** | |
| **Parents** | |
| **Permissions** | |
| **Permissions** | |
| **Range** | |
| **Range** | |
| **[Section](#the-section-field)** | used to divide a setting page into sections; each section comes with a title |
| **[Section](#the-section-field)** | used to divide a setting page into sections; each section comes with a title |
| **[Selectize](#the-selectize-field)** | a hybrid of a text box and a select box. Mostly useful for tagging and other element picking fields. |
| **[Selectize](#the-selectize-field)** | a hybrid of a text box and a select box. Mostly useful for tagging and other element picking fields. |
| **SelectUnique** | |
| **SelectUnique** | |
| **[Taxonomy](#the-taxonomy-field)** | a special select preconfigured to select one or more taxonomies |
| **[Taxonomy](#the-taxonomy-field)** | a special select preconfigured to select one or more taxonomies |
| **ThemeSelect** | |
| **ThemeSelect** | |
| **UserInfo** | |
| **UserInfo** | |
| **Xss** | |
| **Xss** | |
[/div]
</div>
### Common Fields Attributes
### Common Fields Attributes
Every field accepts a list of attributes you can use. Each field could share these common attributes, but particular fields might ignore them. The best way to check which attributes are allowed on a field is to check the field description in this page, and see which attributes are mentioned.
Every field accepts a list of attributes you can use. Each field could share these common attributes, but particular fields might ignore them. The best way to check which attributes are allowed on a field is to check the field description in this page, and see which attributes are mentioned.
This list provides a common ground so there's no need to repeat the description of a common field.
This list provides a common ground so there's no need to repeat the description of a common field.
[div class="table table-keycol"]
<div class="table table-keycol">
| Attribute | Description |
| Attribute | Description |
| :----- | :----- |
| :----- | :----- |
| `autocomplete` | accepts `on` or `off` |
| `autocomplete` | accepts `on` or `off` |
| `autofocus` | if enabled, autofocus on that field |
| `autofocus` | if enabled, autofocus on that field |
| `classes` | accepts a string with one or more CSS classes to add |
| `classes` | accepts a string with one or more CSS classes to add |
| `default` | sets the field default value. This ensures you will always get back either a user-specified value _or_ this default value. See also `placeholder`. |
| `default` | sets the field default value. This ensures you will always get back either a user-specified value _or_ this default value. See also `placeholder`. |
| `disabled` | sets the field disabled state |
| `disabled` | sets the field disabled state |
| `help` | Adds a tooltip to the field |
| `help` | Adds a tooltip to the field |
| `id` | sets the field id as well as the `for` attribute on the label |
| `id` | sets the field id as well as the `for` attribute on the label |
| `label` | sets the field label |
| `label` | sets the field label |
| `name` | sets the field name |
| `name` | sets the field name |
| `novalidate` | sets the field novalidate state |
| `novalidate` | sets the field novalidate state |
| `placeholder` | sets the field placeholder value. This is to set a value the user can see as a prompt for their own value, but it does not influence what value ultimately gets written. See also `default`. |
| `placeholder` | sets the field placeholder value. This is to set a value the user can see as a prompt for their own value, but it does not influence what value ultimately gets written. See also `default`. |
| `readonly` | sets the field read-only state |
| `readonly` | sets the field read-only state |
| `size` | sets the field size, which in turn adds a class to its container. Valid values are `large`, `x-small`, `medium`, `long`, `small`. You can of course add more in the template you see, when used in the frontend |
| `size` | sets the field size, which in turn adds a class to its container. Valid values are `large`, `x-small`, `medium`, `long`, `small`. You can of course add more in the template you see, when used in the frontend |
| `style` | sets the field style. If set to `vertical`, the field is able to appear full width. This is an easy way to clean up the form. |
| `style` | sets the field style. If set to `vertical`, the field is able to appear full width. This is an easy way to clean up the form. |
| `title` | sets the field title value |
| `title` | sets the field title value |
| `toggleable` | add a checkbox that will toggle the enabled/disabled attribute of the field |
| `toggleable` | add a checkbox that will toggle the enabled/disabled attribute of the field |
| `validate.required` | if set to a positive value, sets the field as required |
| `validate.required` | if set to a positive value, sets the field as required |
| `validate.pattern` | sets a validation pattern |
| `validate.pattern` | sets a validation pattern |
| `validate.message` | sets the message shown if the validation fails |
| `validate.message` | sets the message shown if the validation fails |
| `validate.type` | sets the field type used during validation |
| `validate.type` | sets the field type used during validation |
[/div]
</div>
### Know more about fields
### Know more about fields
You can read how the fields are built from the source: [Fields added by the Form Plugin](https://github.com/getgrav/grav-plugin-form/tree/master/templates/forms) and [Fields only available in Admin](https://github.com/getgrav/grav-plugin-admin/tree/master/themes/grav/templates/forms).
You can read how the fields are built from the source: [Fields added by the Form Plugin](https://github.com/getgrav/grav-plugin-form/tree/master/templates/forms) and [Fields only available in Admin](https://github.com/getgrav/grav-plugin-admin/tree/master/themes/grav/templates/forms).
will validate the field value against the passed regex pattern. Examples: `pattern: "[1-9][0-9]*"`, `pattern: '[A-Za-z0-9-]+'`, `pattern: '[a-z0-9-]+'`, ` pattern: '^[a-z0-9_-]{3,16}$'`, `pattern: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}'`
will validate the field value against the passed regex pattern. Examples: `pattern: "[1-9][0-9]*"`, `pattern: '[A-Za-z0-9-]+'`, `pattern: '[a-z0-9-]+'`, ` pattern: '^[a-z0-9_-]{3,16}$'`, `pattern: '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}'`
#### validate.type
#### validate.type
`validate.type` indicates which type should it validate against.
`validate.type` indicates which type should it validate against.