Skip to content

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:

ParameterRequiredTypeDescription
handleYesStringThe form handle from your Statamic form configuration. Also used as the formHandler identifier for events.
precognitionFalseBooleanUse Laravel Precognition for live form validation. Read more about this feature here.
wizardFalseBooleanEnable multi-step wizard style forms. Read more here.
viewNoStringCustom view template to use for rendering the form. Default: "form/_form_component"
hide_fieldsNoStringPipe-separated list of field handles to hide from the form (e.g., "field1|field2").
prepopulated_dataNoArrayArray of field values to prepopulate. Pass as key-value pairs.
submit_textNoStringCustom text for the submit button
success_messageNoStringCustom 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:

antlers
{{ easyform handle="contact_form" }}

With hidden fields:

antlers
{{ easyform handle="contact" hide_fields="internal_notes|admin_only" }}

With prepopulated data:

antlers
{{ easyform handle="contact" :prepopulated_data="['entry_title_field' => title, 'date_field' => (now | format('Y-m-d'))]" }}

With custom view:

antlers
{{ easyform handle="contact" view="forms/custom-contact-form" }}

With custom submit text and success message:

antlers
{{ easyform handle="contact" submit_text="Send Message" success_message="Thank you for reaching out! We'll be in touch soon." }}