Back to buttons

Live preview

Preview settings

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

⌘ / Ctrl + S saves locally

Primary button · ArturCodeCraft

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

By ArturCodeCraft

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 Primary button · ArturCodeCraft

Primary button · ArturCodeCraft is an animated CSS button by ArturCodeCraft. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.

Effects and categories
Hover effects
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="primary-button">
  Primary button
</button>

CSS


/* <reset-style> ============================ */
button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
}
/* <main-style> ============================ */
.primary-button {
  min-width: 111px;
  height: 56px;
  border-radius: 40px;
  background: #000;
  padding: 16px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.32px;
  transition: background .2s ease-in-out, color .2s ease-in-out;
  position: relative;
}

.primary-button::before {
  content: '';
  width: 100%;
  height: 100%;
  border-radius: 40px;
  background: linear-gradient(69deg, #c3aab2 -4.77%, #9ec 46.72%, #80c0c8 90.23%, #4B8bfa 134.46%);
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  z-index: -1;
  transition: opacity .2s ease-in-out;
}

.primary-button:hover {
  background: transparent;
  color: #000;
}

.primary-button:hover::before {
  opacity: 1;
}