Every button fetches the same HTML fragment. Only minu-swap changes where
the fragment lands relative to its target.
Want state preserved across a swap? See Morph vs innerHTML.
Replace children.
Replace this box.
Insert before.
Insert first child.
Append as last child.
Insert after.
Remove this box.
Fetch, but do not swap.
| Mode | Result |
|---|---|
innerHTML (default) | Replace the target’s children. |
outerHTML | Replace the target itself. |
beforebegin | Insert before the target. |
afterbegin | Insert as the target’s first child. |
beforeend | Insert as the target’s last child. |
afterend | Insert after the target. |
delete | Remove the target, ignore the response body. |
none | Fetch but do not swap; useful for side effects/events. |
swap() applies the requested mode.delete and none still fire the normal request and content events.outerHTML and delete remove their target; reload to reset those boxes.<button minu-get="/demo/fragment"
minu-trigger="click"
minu-target="#swap"
minu-swap="beforeend">
Append
</button>
<div id="swap">…</div>