Popover targets

One panel, three actions

Outside buttons use popovertarget to reach the component’s panel.

Try: Toggle twice, then try Show and Hide.

DOM observationWaiting for setup.
Behavior & limits

Repeating Show or Hide keeps the same state. This manual popover closes through Hide or its internal close button.

The adapter requires the native Popover API. Event ordering and accessibility relationships can differ from native Reference Target.

Code sample

Manual popover with an internal close button.

<button id="pt-toggle" type="button" popovertarget="pt-host"
    popovertargetaction="toggle">Toggle panel</button>
<rt-popover-target-demo id="pt-host" data-reference-target="pt-panel">
  <template shadowrootmode="open" shadowrootreferencetarget="pt-panel">
    <section id="pt-panel" popover="manual" role="dialog"
        aria-labelledby="pt-panel-title">
      <h2 id="pt-panel-title">The host leads here</h2>
      <button id="pt-close" type="button" popovertarget="pt-panel"
          autofocus
          popovertargetaction="hide">Close panel</button>
    </section>
  </template>
</rt-popover-target-demo>

Functional JavaScript sizes

Functional page JavaScript

5.004 KB 2.242 KB gzip

Always loaded.

Fallback additional

18.991 KB 6.891 KB gzip

Core + selected adapters.

Fallback route total

23.995 KB 9.133 KB gzip

Always-loaded and fallback files; shared files counted once.

Native-surface route total

5.993 KB 2.780 KB gzip

Includes 0.989 KB (0.538 KB gzip) of behavioral probes requested only after the property surface is present.

Minified / gzip. 1 KB = 1,000 bytes. Demo-only syntax highlighting is excluded from the functional totals and reported separately below.

Whole-page delivery context

HTML document

15.034 KB 1 request

Generated markup, including these measurements.

Initial supporting assets

21.802 KB raw 21.179 KB local transfer · 4 requests

Styles, icon, and the highlighting scheduler; functional JS is separate above.

Initial page with fallback

60.831 KB raw 45.346 KB local transfer · 10 requests

Document + functional fallback path + initial supporting assets, with unique files counted once.

Deferred highlighting

16.700 KB raw 7.831 KB local transfer · 8 requests

Engine, theme, and this page’s grammar closure, requested after a source disclosure opens or during idle time.

“Local transfer” matches the included development server: gzip JavaScript sidecars, but uncompressed HTML, CSS, and SVG. GitHub Pages, browser caching, HTTP headers, and production compression can change transferred bytes and request scheduling. Module preloads fetch functional modules early without evaluating the app and do not add duplicate transfers.

Inspect the 6 generated JavaScript files

Selected adapters: popover-targets.

Gzip totals sum each compressed file. The fallback and native-probe routes are mutually exclusive. Separate CSS files, HTML, JSON, source maps, HTTP headers, and Microlighter assets are excluded. Component styles embedded in JavaScript are included. Transfer sizes depend on compression and caching. Microlighter MIT license.

Files included in this page’s totals
FileDeliveryMinifiedGzip
popover-targets/main.js Page 3.257 KB 1.352 KB
shared/chunks/app-CP7YFVEN.js Page 1.605 KB 0.752 KB
shared/chunks/chunk-CLCOZ6O7.js Fallback / native probe shared 0.849 KB 0.422 KB
shared/chunks/chunk-S2QLMWTP.js Page 0.142 KB 0.138 KB
shared/chunks/detect-X6QVIAY4.js Native-surface probe 0.140 KB 0.116 KB
shared/chunks/reference-target.setup-Z6ZTKSGX.js Fallback additional 18.142 KB 6.469 KB

Inspect the size manifest

Implementation notes & limitations

Fallback scope

Requires the browser’s Popover API. Event paths and automatic accessibility relationships may differ from native forwarding.

Readouts describe DOM state. Check computed names, keyboard behavior and assistive technology separately.