Skip to content

Examples

Notification settings card

Four checkbox rows pair a short label with a one-line description, closed by a single full-width primary.

Preview

Notifications

Choose which alerts land in your inbox.

Deposits, withdrawals, and transfers.
Login attempts and account changes.
Updates at 25%, 50%, 75%, and 100%.
Daily portfolio summary and price alerts.
HTML
<bs:bsui-card>
  <bs:bsui-card-header>
    <bs:bsui-card-title label="Notifications" />
    <bs:bsui-card-description label="Choose which alerts land in your inbox." />
  </bs:bsui-card-header>
  <bs:bsui-card-content>
    <bs:bsui-stack direction="column" gap="3" align="stretch">
      <bs:bsui-stack direction="column" gap="1" align="stretch">
        <bs:bsui-checkbox label="Transaction alerts" defaultChecked="true" />
        <bs:bsui-text content="Deposits, withdrawals, and transfers." variant="caption" tag="span" />
      </bs:bsui-stack>
      <bs:bsui-stack direction="column" gap="1" align="stretch">
        <bs:bsui-checkbox label="Security alerts" defaultChecked="true" />
        <bs:bsui-text content="Login attempts and account changes." variant="caption" tag="span" />
      </bs:bsui-stack>
      <bs:bsui-stack direction="column" gap="1" align="stretch">
        <bs:bsui-checkbox label="Goal milestones" />
        <bs:bsui-text content="Updates at 25%, 50%, 75%, and 100%." variant="caption" tag="span" />
      </bs:bsui-stack>
      <bs:bsui-stack direction="column" gap="1" align="stretch">
        <bs:bsui-checkbox label="Market updates" />
        <bs:bsui-text content="Daily portfolio summary and price alerts." variant="caption" tag="span" />
      </bs:bsui-stack>
      <bs:bsui-button label="Save preferences" variant="default" />
    </bs:bsui-stack>
  </bs:bsui-card-content>
</bs:bsui-card>

How it works

Every checkbox maps to a key of a notifications object in the store, and toggling writes context immediately while the save action persists the whole object at once. The description lines are linked to their checkboxes so assistive tech reads each pair together.

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.