{{# @name Form @desc The form page builder block. @set page.page_builder.form #}} {{ partial:page_builder/block }}
{{ block:heading ?= { partial:typography/h1 as="h2" class="mb-8" :content="block:heading" } }} {{ block:text ?= { partial:typography/p :content="block:text" } }} {{# Render form and use Alpine based Statamic conditional logic. #}} {{ if form:handle }} {{ form:create :in="form:handle" js="alpine:form" attr:x-ref="form" }} {{# Use Laravel Precognition for live validation and submission. #}}
{{# Error notifications. #}} {{# Polite live notifications for screen readers only. #}} {{# Honeypot spam protection. #}} {{# Render various form sections. #}} {{ sections }}
{{ if display || instructions }} {{ display ?= { partial:typography/h2 class="mb-2" as="legend" content="{ trans :key="display" }" } }} {{ instructions ?= { partial:typography/p content="{ trans :key="instructions" }" } }} {{ /if }} {{# Render the default-styled fields. #}} {{ %form:fields scope="field" }} {{ /%form:fields }}
{{ /sections }} {{# Submit button, disabled on processing. #}}
{{ partial:components/button as="button" button_type="button" label="{ trans:strings.form_send }" }} {{ slot:attributes }} @click.prevent="submit" :disabled="form.processing" :class="{ 'opacity-25 cursor-default': form.processing }" {{ /slot:attributes }} {{ /partial:components/button }}
{{ /form:create }} {{# Call in the Peak Tools Alpine Based Precognition Form Handler. #}} {{ partial:statamic-peak-tools::snippets/form_handler }} {{ /if }}
{{ /partial:page_builder/block }}