Skip to content

Examples

Badge with explanation

A status badge gets a hover explanation from a tooltip beside it, since the tooltip block renders its own button and cannot wrap the badge.

Preview

v1 REST endpoints Deprecated
HTML
<bs:bsui-stack direction="row" gap="2" align="center">
  <bs:bsui-text content="v1 REST endpoints" variant="label" tag="span" />
  <bs:bsui-badge label="Deprecated" variant="warning" />
  <bs:bsui-tooltip openDelay="0">
    <bs:bsui-tooltip-trigger trigger_label="?" trigger_variant="ghost" trigger_size="icon-sm" />
    <bs:bsui-tooltip-popup content="Version 1 stops responding in June 2027. Move integrations to v2 before then." />
  </bs:bsui-tooltip>
</bs:bsui-stack>

How it works

The tooltip store owns only its icon trigger, leaving the badge as plain inert text, and shows the popup on hover or focus of that button. Context holds the open state so the popup can flip sides when it would clip the preview frame.

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.