← All examples

Tabs + shared target

Three triggers, one content area. None of the tab buttons contains a target; Minu falls back to the single [minu-content] on the page.

Loading tab…

Click a tab above to load content.

How it works

  1. Each tab is a normal click trigger with its own minu-get URL.
  2. No tab has a minu-target or inner [minu-content].
  3. Minu finds the one shared [minu-content] in the card and swaps there.
  4. The shared loader is also found once, so it does not replace the tab label.
  5. Clicking quickly aborts the previous request; only the latest response wins.
<button minu-get="tab1.html" minu-trigger="click">Tab 1</button>
<button minu-get="tab2.html" minu-trigger="click">Tab 2</button>

<div class="loader" minu-loader>Loading…</div>
<div minu-content></div>

The active-tab styling is separate page JavaScript. Minu only handles the request and swap.