MarkupRefineLib

Menu


Progressive enhancement

Behavior discovery uses only data-mr-*. Presentation classes are not runtime identity and the CSS remains useful when the JavaScript bundle is omitted.

Native and ARIA state first

Tabs

<nav class="mr-nav-tabs" role="tablist" aria-label="Example tabs">
  <button data-mr-tab="one" data-mr-tabs-group="demo">One</button>
  <button data-mr-tab="two" data-mr-tabs-group="demo">Two</button>
</nav>
<section data-mr-panel="one" data-mr-tabs-group="demo" data-mr-tabs-default>First panel</section>
<section data-mr-panel="two" data-mr-tabs-group="demo">Second panel</section>
First panel
Second panel

No-JavaScript baseline

EnhancementWithout JavaScript
Copyable snippetCode stays readable.
Clickable-list filterThe complete list remains visible.
Resettable file inputThe native file input remains usable.
Single-page tabsAll authored panels remain visible.
Navigation shellNavigation content remains reachable.
SearchProvide a normal form/link fallback when no-JS search is required.
Tooltip explanationEssential meaning remains in normal page content; tooltip text is supplementary only.
Remote Layer subinteractionThe same URL is a complete standalone page, and opted-in forms submit through their real action/method. Multipart forms use native browser submission before enhancement and browser-created FormData after enhancement.

SSR and repeated initialization

import { initMarkupRefineBehaviors } from "markup-refine-lib/behaviors";

initMarkupRefineBehaviors(container);

The initializer is SSR-safe and idempotent. It registers [data-mr-layer] surfaces and [data-mr-tooltip] triggers in the supplied root.

Remote navigation is deliberately excluded. Opt into initLayerNavigation() from markup-refine-lib/layer-navigation only where HTTP enhancement is wanted.

Stable Layer degradation contract

Layer enhancement is capability-gated. Failure at a higher capability level must leave the authored lower-capability task usable rather than hiding it behind partially prepared UI. Markup Refine does not provide a generic “enhanced” marker that authors must style around, and it never auto-promotes an unsupported popover into a modal.

See the Stable Layer API for the permanent degradation matrix covering no JavaScript, no CSS, unsupported native APIs, initialization failure, late initialization, and remote request failure.