← All elements

Busy Dots Button

by @admin · 1 views

<label class="ldb"><input type="checkbox"><span>Save changes</span><i></i><i></i><i></i></label>

About this button

A save button that swaps its label for three bouncing dots while a checkbox state says the work is running.

How it works

A hidden checkbox inside the label holds the busy state. While it is checked, the text becomes invisible and three dots appear, each bouncing with a slightly later delay. The :has() selector darkens the whole button at the same time, so no script is needed to preview the effect.

Ways to customise it

  • Change #047857 for another button colour.
  • Change the delays to alter the bounce rhythm.
  • Replace the label text with your own action.

Good to know

In a real application, set the checked state from your code when saving starts and clear it when it ends, and announce the result in a live region. The checkbox keeps keyboard access and shows a focus outline.

Open an example, copy the HTML and the CSS, and paste them into your page. There is nothing to install and no JavaScript to load.

More in Buttons

View all →