Spinner on Button CSS Generator
A spinner inside a button tells people their click worked and that they should not press it again. Generate a small, thin ring here, then copy the CSS and place it beside the button label.
How to make a button spinner
-
1
Use a small size
Enter 16 or 18 in the size field so the ring fits the button text height.
-
2
Make the ring thin
Set the thickness to 2 so the arc stays crisp at this size.
-
3
Match the color
Pick the color of the moving arc, for example white on a dark button.
-
4
Speed up slightly and copy
Try 0.8 seconds per turn, then copy the CSS.
A worked example
Suppose you have a dark blue “Save” button with white text. In the generator, enter size 16, thickness 2, color #ffffff and speed 0.8. The tool produces:
.loader {
width: 16px;
height: 16px;
border: 2px solid #eee;
border-top-color: #ffffff;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
The ring track is a fixed light gray, which is visible on a dark button. If you want a subtler track, change #eee to a translucent value such as rgba(255, 255, 255, 0.3) in the pasted CSS. The arc color stays whatever you picked.
Place it inside the button
Put the spinner element before the label and make the button a flex row so they sit on one line with a gap:
<button class="save" type="submit" disabled>
<span class="loader" role="status" aria-label="Saving"></span>
Saving
</button>
.save {
display: inline-flex;
align-items: center;
gap: 8px;
}
Add the spinner and the disabled state only while the request is running. Remove both when it finishes. Disabling the button is what stops double submissions; the spinner is the signal that explains why.
Size and thickness for buttons
| Button text size | Spinner size | Thickness |
|---|---|---|
| 14 px | 14 px | 2 px |
| 16 px | 16 to 18 px | 2 px |
| 18 to 20 px | 20 to 24 px | 3 px |
Notes
- The generator makes one circular ring. It does not create a button, so your button styles stay your own.
- A ring thicker than a quarter of its diameter fills up and looks like a disc, so keep thin values at small sizes.
- Keep the label next to the spinner. A spinner with no text can be hard to interpret for some users.
Avoid layout jumps
If the spinner appears and the button suddenly grows wider, the layout shifts and the click target moves. Two easy fixes help. Give the button a minimum width that already fits the spinner and the longer label. Or reserve the spinner space from the start by showing an empty 16 px placeholder before the label. Because the generated ring has a fixed width and height in pixels, it is easy to reserve exactly the room it needs.
Frequently Asked Questions
About the same height as the button text, usually 14 to 20 pixels. That keeps the button from growing when the spinner appears.
Yes, in most forms. Disabling prevents duplicate submissions, and the spinner explains to the visitor why nothing else is clickable.
The track is light gray and the arc is the color you choose. On a light button, pick a darker arc color and change the track color in the pasted CSS.
No. The generator only outputs the ring CSS. Whether you keep, change or hide the label is up to your markup.
Related Tools
Color Wheel Explorer
Explore the colour wheel interactively. Rotate harmonies, compare HSL vs RYB, spot complementary and triadic pairs in real time.
FPS Counter
Measure browser FPS with requestAnimationFrame, smoothing, min/max frame rate, warnings and an optional graph. Runs locally with no upload or API.
Placeholder Image Generator
Create a 1–4000 px placeholder with custom colors and text, download it as PNG, or copy a URL and HTML image tag.
Random Phone Number Generator
Generate 1 to 50 fictional phone numbers from officially reserved ranges for the US, Canada, UK, Australia or Germany.
GitHub Profile README Generator
Build the README.md for your GitHub profile page (the username/username repo) with tagline, skills, stats cards and language breakdown.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
Tool available in other languages
- เครื่องมือสร้างสปินเนอร์ในปุ่ม CSS [TH]
- Generator spinera na przycisku w CSS [PL]
- Trình tạo spinner cho nút bằng CSS [VI]
- Generator CSS Spinner untuk Tombol [ID]
- مولّد CSS لدوّامة الزر [AR]
- CSS-Spinner für Buttons Generator [DE]
- ボタン用スピナー CSS ジェネレーター [JA]
- Gerador de CSS de spinner para botão [PT]
- Generador de CSS de spinner para botones [ES]
- 버튼 스피너 CSS 생성기 [KO]
- Generator för spinner i knappar i CSS [SV]
- Générateur de CSS pour spinner de bouton [FR]
- CSS-spinner voor knoppen generator [NL]
- Generatore di CSS per spinner nei pulsanti [IT]
- Генератор спиннера для кнопки в CSS [RU]
- Buton İçin CSS Spinner Oluşturucu [TR]
- 按钮加载动画 CSS 生成器 [ZH]