Skip to content

Examples

Toast after submit

Submitting a small form queues a confirmation toast, shown here in the moment just after a successful save.

Preview

Weekly report

A summary of deploys and failures, sent every Monday.

Weekly report scheduled for Mondays at 9:00.
HTML
<bs:bsui-stack direction="column" gap="4" align="stretch">
  <bs:bsui-card>
    <bs:bsui-card-header>
      <bs:bsui-card-title label="Weekly report" />
      <bs:bsui-card-description label="A summary of deploys and failures, sent every Monday." />
    </bs:bsui-card-header>
    <bs:bsui-card-content>
      <bs:bsui-field>
        <bs:bsui-field-label text="Send to" />
        <bs:bsui-input type="email" name="report_email" defaultValue="m@example.com" />
      </bs:bsui-field>
    </bs:bsui-card-content>
    <bs:bsui-card-footer>
      <bs:bsui-button label="Save schedule" variant="default" />
    </bs:bsui-card-footer>
  </bs:bsui-card>
  <bs:bsui-toast-provider position="bottom-right">
    <bs:bsui-toast message="Weekly report scheduled for Mondays at 9:00." />
  </bs:bsui-toast-provider>
</bs:bsui-stack>

How it works

The submit action writes the saved schedule into the store and appends an entry to the toast list kept in provider context. The provider renders that queue in a polite live region, so the confirmation is announced without moving focus off the form.

Every behaviour on this page is the WordPress Interactivity API: each component registers its own store, seeds its state in a server rendered context, and wires events with directives in the markup above. There is no page specific JavaScript.