Live preview
Preview settings
Changes appear as you type. Use Tab to test keyboard focus.
⌘ / Ctrl + S saves locally
catraco's minimal button
HTML, CSS or Tailwind, and a little JavaScript. One button or a group of up to six.
By catraco
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 catraco's minimal button
catraco's minimal button is an animated CSS button by catraco. Preview the interaction, customize its HTML, styles and JavaScript, or download the files with creator credit.
- Effects and categories
- Minimal
- 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="btn-class-name">
<span class="back"></span>
<span class="front"></span>
</button>CSS
.btn-class-name {
--primary: 255, 90, 120;
--secondary: 150, 50, 60;
width: 60px;
height: 50px;
border: none;
outline: none;
cursor: pointer;
user-select: none;
touch-action: manipulation;
outline: 10px solid rgb(var(--primary), .5);
border-radius: 100%;
position: relative;
transition: .3s;
}
.btn-class-name .back {
background: rgb(var(--secondary));
border-radius: 100%;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.btn-class-name .front {
background: linear-gradient(0deg, rgba(var(--primary), .6) 20%, rgba(var(--primary)) 50%);
box-shadow: 0 .5em 1em -0.2em rgba(var(--secondary), .5);
border-radius: 100%;
position: absolute;
border: 1px solid rgb(var(--secondary));
left: 0;
top: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.2rem;
font-weight: 600;
font-family: inherit;
transform: translateY(-15%);
transition: .15s;
color: rgb(var(--secondary));
}
.btn-class-name:active .front {
transform: translateY(0%);
box-shadow: 0 0;
}