Loading button

Button that swaps its label for a spinner while it works. Click to toggle the demo.

CSS onlySpinner
BackgroundGridAccent

Corners

SharpDefaultRound

Shadow

NoneNoneStrong

Motion

NoneDefaultBounce
<style>
.ux-lb{display:inline-block;cursor:pointer}
.ux-lb input{position:absolute;opacity:0;pointer-events:none}
.ux-lb-b{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-width:160px;height:44px;padding:0 22px;border-radius:var(--rp,999px);background:var(--accent,#cc4a26);color:#fff;font:600 15px system-ui;transition:opacity var(--dur,.2s) var(--ease,ease)}
.ux-lb-t::after{content:"Save changes"}
.ux-lb-s{display:none;width:16px;height:16px;border-radius:50%;border:2px solid rgba(255,255,255,.35);border-top-color:#fff;animation:ux-lbs var(--dur,.7s) var(--ease,linear) infinite}
.ux-lb input:checked+.ux-lb-b{opacity:.85}
.ux-lb input:checked+.ux-lb-b .ux-lb-s{display:block}
.ux-lb input:checked+.ux-lb-b .ux-lb-t::after{content:"Saving..."}
.ux-lb input:focus-visible+.ux-lb-b{outline:2px solid var(--accent,#cc4a26);outline-offset:3px}
@keyframes ux-lbs{to{transform:rotate(360deg)}}
</style>

<label class="ux-lb"><input type="checkbox"><span class="ux-lb-b"><i class="ux-lb-s"></i><span class="ux-lb-t"></span></span></label>

When to use it

Use this for an action someone triggers directly — submitting, confirming, or moving to the next step. Keep the label a short verb so the intent is obvious.

Accessibility

Check that it reaches every state with the keyboard alone before you ship it, and keep the focus ring instead of removing it for looks. It has no JavaScript dependency, so it keeps working if a script fails to load, and it is built on native form controls or semantics rather than divs pretending to be one. Colors are read from CSS custom properties, so they follow your light or dark theme and you can raise contrast globally without touching this component.