Guide

Form Message

Displays a message after successful form submission. Hidden until state.formMessage is set.

Namespace

prc-block/form-message

Category

forms

Inserter preview

block.json example includes a core/paragraph (“Thank you for your submission!”), matching the default template.

Supports

FeatureEnabledDetails
AnchorNo
HTML editingNo
ReusableYes
InteractivityYes
SpacingYesblockGap, margin (top/bottom), padding
ColorYesBackground, text, link, button
TypographyYesFont size, font family

Attributes

No custom attributes. Content is composed with inner blocks.

Styles

No registered style variations in block.json. Stylesheet supports is-style-overlay for a fixed full-screen overlay.

Inner blocks

Default template: core/paragraph (“Thank you for your submission!”).

Allowed: core/paragraph, core/heading, core/group, core/buttons, core/button, core/separator, core/image, prc-block/form-input-text

form-input-text is supported for message-state inputs (for example email collection inside the message layer).

Parent / ancestor

No explicit ancestor in block.json. Designed for use inside prc-block/form (or Mailchimp form wrappers in block-library).

Usage

  1. Add inside a form structure.
  2. Compose message content with inner blocks.
  3. Recommended: Bind a paragraph’s content to the Form Result Message source (prc-block/form-message). New form-message blocks default to this binding.
  4. Legacy: Template tokens {{message}}, {{form message}}, {{form-message}}, or {{form_message}} are replaced at render with a span bound to state.formMessage.
  5. The block stays hidden until state.formMessage is truthy.

Block markup example

With block binding (recommended):

<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"prc-block/form-message"}}}} -->
<p data-wp-text="state.formMessage"></p>
<!-- /wp:paragraph -->

With legacy token replacement, the wrapper receives data-wp-class--is-displaying-form-message="state.formMessage".

PHP rendering

Server-side via Form_Message:

  1. Wraps inner content with interactivity bindings.
  2. Replaces legacy tokens with <span data-wp-text="state.formMessage"></span>.
  3. Bound paragraphs get data-wp-text via inject_message_binding on render_block.

Frontend interactivity

No standalone view.js. Parent form store sets state.formMessage after submit.

Was this helpful?