Back to buttons

Live preview

Preview settings

Changes appear as you type. Use Tab to test keyboard focus.

⌘ / Ctrl + S saves locally

sammykINC's icon button

HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.

By sammykINC

Remix button

Button submission checks

Checks will appear after the preview updates.

Buttons only: no full pages, forms, cards or navigation. Put scripts in the JavaScript tab. Tailwind uses utilities from HTML and JavaScript; use complete class names. Custom CSS supports plain CSS, without @apply, imports or plugins.

Accessibility quick check

Waiting for the rendered preview…

Try Tab, Enter and Space in the preview. Check the focus ring, hover and disabled states, then enable Reduce motion. These checks are guidance, not an accessibility certification.

Explore freely here. Remix to publish your version with credit to the creator.

About sammykINC's icon button

sammykINC's icon button is an animated CSS button by sammykINC. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Icon, Animated
Using this example
Copy the HTML or download index.html, style.css and app.js. Test keyboard focus, motion and contrast in your own project.

Usage, Tailwind and licensing questions

Read the source files

HTML

<button class="button">
  <svg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
  <path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128ZM128,72a12,12,0,1,0-12-12A12,12,0,0,0,128,72Zm0,112a12,12,0,1,0,12,12A12,12,0,0,0,128,184Z"></path></svg>
</button>

CSS


/* works only on a dark background with these paremeters*/

.button {
  border-radius: 50%;
  border: none;
  display: flex;
  place-items: center;
  background-color: transparent;
  cursor: pointer;
}

.button > svg {
  border-radius: inherit;
  padding: 0.5rem;
  fill: #fff;
 /* SVG color */
  width: 38px;
 /* default width 32px */
  height: 38px;
 /* default height 32px */
}

.button > svg:active {
  background-color: rgba(65, 65, 65, 0.5);
}

.button > svg:not(:active) {
  animation: fadeOut 0.9s;
}

@keyframes fadeOut {
  0% {
    outline: 1px solid rgba(90, 90, 90, 0.5);
 /* If you use border it will take space inside and slightly move the SVG */
  }

  100% {
    background-color: transparent;
  }
}