Labels

An outside label, an inside control

A label reaches the checkbox selected by the component.

Try: Click either label, then its checkbox.

Reference the host by ID

DOM observationWaiting for setup.

Wrap the component in its label

DOM observationWaiting for setup.
Behavior & limits

The first outside label uses for; the second contains its component. Each component also owns a visually hidden native fallback label, so its checkbox stays named when outward element-reference naming is unavailable. Where supported, the adapter merges the outside label with that local name.

It does not create native label.control or input.labels links. DOM readouts do not verify accessible names or screen-reader behavior.

Code sample

Explicit-label markup. Fallback setup hydrates data-reference-target; styling and readiness flags are omitted.

<label id="lj-checkbox-label" for="lj-checkbox-host">Send me release notes</label>
<rt-gallery-checkbox id="lj-checkbox-host" data-reference-target="control">
  <template shadowrootmode="open" shadowrootreferencetarget="control">
    <label class="visually-hidden" for="control">Release notes preference</label>
    <input id="control" type="checkbox">
  </template>
</rt-gallery-checkbox>

Functional JavaScript sizes

Functional page JavaScript

4.398 KB 2.026 KB gzip

Always loaded.

Fallback additional

20.951 KB 7.528 KB gzip

Core + selected adapters.

Fallback route total

25.349 KB 9.554 KB gzip

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

Native-surface route total

5.387 KB 2.564 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.154 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

62.305 KB raw 45.887 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: labels.

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
labels/main.js Page 3.257 KB 1.351 KB
shared/chunks/app-ERKZUBYG.js Page 0.999 KB 0.537 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-VHWBBDI4.js Fallback additional 20.102 KB 7.106 KB

Inspect the size manifest

Implementation notes & limitations

Fallback scope

The adapter uses focus-and-click activation and optional outward ARIA reflection. It does not recreate native label.control or control.labels relationships.

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