General
The easyform tag renders a form in your templates. It loads form data similarly to the native Statamic form tag but includes additional features and does not render fields beforehand.
Tag Parameters
The tag accepts several parameters to customize form behavior and appearance:
| Parameter | Required | Type | Description |
|---|---|---|---|
handle | Yes | String | The form handle from your Statamic form configuration. Also used as the formHandler identifier for events. |
precognition | False | Boolean | Use Laravel Precognition for live form validation. Read more about this feature here. |
wizard | False | Boolean | Enable multi-step wizard style forms. Read more here. |
view | No | String | Custom view template to use for rendering the form. Default: "form/_form_component" |
hide_fields | No | String | Pipe-separated list of field handles to hide from the form (e.g., "field1|field2"). |
prepopulated_data | No | Array | Array of field values to prepopulate. Pass as key-value pairs. |
submit_text | No | String | Custom text for the submit button |
success_message | No | String | Custom text for the success message after submission |
The hide_fields parameter
This parameter allows you to hide specific fields from the form by passing a pipe-separated list of field handles (e.g., "field1|field2"). Unlike using a hidden Text field type, this parameter lets you maintain a single form in the Control Panel while hiding specific fields in different frontend contexts.
The prepopulated_data parameter
This parameter allows you to prepopulate specific fields by passing an array of key-value pairs. This is particularly useful for populating hidden fields with data from Antlers or an external source.
Note
If you simply want to set a default value for a field, use the field's default parameter instead.
Examples
Basic usage:
{{ easyform handle="contact_form" }}With hidden fields:
{{ easyform handle="contact" hide_fields="internal_notes|admin_only" }}With prepopulated data:
{{ easyform handle="contact" :prepopulated_data="['entry_title_field' => title, 'date_field' => (now | format('Y-m-d'))]" }}With custom view:
{{ easyform handle="contact" view="forms/custom-contact-form" }}With custom submit text and success message:
{{ easyform handle="contact" submit_text="Send Message" success_message="Thank you for reaching out! We'll be in touch soon." }}