CSS Round Icon Button

Circular icon-only buttons in solid, soft and outline styles, each with an accessible label.

  • icon only
  • circle
  • svg
  • aria-label
  • toolbar
HTML
<button class="btn-icon" aria-label="Add">
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</button>
<button class="btn-icon btn-icon-soft" aria-label="Search">
  <svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
</button>
<button class="btn-icon btn-icon-outline" aria-label="Notifications">
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg>
</button>
CSS
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-icon:hover {
  background: #4338ca;
}

.btn-icon:active {
  transform: scale(0.94);
}

.btn-icon-soft {
  background: #eef2ff;
  color: #4338ca;
}

.btn-icon-soft:hover {
  background: #e0e7ff;
}

.btn-icon-outline {
  border-color: #d4d4d8;
  background: #fff;
  color: #3f3f46;
}

.btn-icon-outline:hover {
  background: #f4f4f5;
}

.btn-icon:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 3px;
}

About this CSS Round Icon Button

This CSS Round Icon Button is 55 lines of pure CSS (0.8 KB) with no JavaScript and no dependencies. It uses transitions, transforms, CSS Grid and keyboard focus styles. It works in current versions of Chrome, Edge, Safari and Firefox. It works in any stack: plain HTML, React, Vue, Svelte, Astro, WordPress or Webflow.

CSS features used

Customize it

The colors in this snippet. Search and replace them to match your brand:

  • #4f46e5
  • #fff
  • #4338ca
  • #eef2ff
  • #e0e7ff
  • #d4d4d8
  • #3f3f46
  • #f4f4f5

How to use this round icon button

  1. Copy the HTML and paste it where you want the element to appear.
  2. Copy the CSS into your stylesheet, or inside a <style> tag.
  3. Keep the .btn-icon class name, or rename it in both places. Then tweak colors, sizes and timing to match your design.
  4. Using React or Next.js? Change class to className in the HTML. The CSS works as is, including in Tailwind projects (put it in your global stylesheet).

Building with an AI tool?

“Copy for AI” copies a short prompt for Cursor, Claude Code, Lovable, Bolt or v0. Your AI tool opens the Markdown version of this snippet and reads the HTML, CSS and setup notes there. If your tool can't open links, with the code instead. More ways to use copy CSS with AI.

Feedback