Guide

Form Page

Primitive container for one step in a multi-page form. Ancestor must be prc-block/form.

Namespace

prc-block/form-page

Category

forms

Block inserter example

block.json defines an example with a core/paragraph (“Form page content.”). Ancestor is prc-block/form.

Supports

FeatureEnabledDetails
AnchorYes
HTML editingNo
ReusableNo
InteractivityYes
ColorYesBackground, text, link
LayoutYesFlex, vertical orientation; sizing on children
SpacingYesblockGap, padding, margin
TypographyYesFont size, line height, family, weight

Attributes

No custom attributes. Acts as a page container for fields.

Inner blocks

Yes. Place form inputs, headings, paragraphs, and other form elements for one step.

Parent / ancestor

Ancestor: prc-block/form

Usage

  1. Inside a Form block, add one or more Form Page blocks.
  2. Put fields for each step inside the matching page.
  3. The parent form store shows only the active page (state.isPageHidden / hidden).
  4. Navigation is managed by the parent form interactivity store.

Block markup example

<div
	class="wp-block-prc-block-form-page"
	id="prc-block-form-page-1"
	data-wp-interactive="prc-block/form"
	data-wp-bind--hidden="state.isPageHidden"
	data-wp-context='{"pageId":"prc-block-form-page-1"}'
>
	<!-- Form fields for this page -->
</div>

PHP rendering

Server-side via render_block_callback in Form_Page:

  1. Assigns a unique page id (e.g. prc-block-form-page-1).
  2. Binds data-wp-interactive="prc-block/form".
  3. Adds data-wp-bind--hidden="state.isPageHidden".
  4. Sets data-wp-context with the page ID.

Frontend interactivity

No standalone view.js. Visibility comes from the parent prc-block/form store. [hidden] uses display: none in block CSS.

Was this helpful?