Success Checkmark Button
Button that transforms into a success checkmark on completion
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/success-button.
<iframe src="/embed/success-button" sandbox="allow-scripts" loading="lazy" title="Success Checkmark Button" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Success Checkmark Button, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<button class="success-button">
<svg class="checkmark" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path d="M5 13l4 4L19 7" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
Success!
</button>CSS
.success-button {
padding: 1rem 2rem;
border-radius: 0.75rem;
background: #10b981;
color: white;
font-weight: 600;
border: none;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
transition: all 0.3s ease;
}
.success-button:hover {
background: #059669;
}
.checkmark {
width: 1.5rem;
height: 1.5rem;
animation: checkmark-draw 0.5s ease;
}
@keyframes checkmark-draw {
from {
stroke-dasharray: 100;
stroke-dashoffset: 100;
}
to {
stroke-dasharray: 100;
stroke-dashoffset: 0;
}
}LWC — HTML template
<template>
<button class="success-button" onclick={handleClick}>
<svg class="checkmark" viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path d="M5 13l4 4L19 7" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<slot>Success!</slot>
</button>
</template>LWC — JavaScript
import { LightningElement, api } from 'lwc';
export default class SuccessButton extends LightningElement {
@api label = 'Success!';
handleClick() {
this.dispatchEvent(new CustomEvent('buttonclick', {
bubbles: true,
composed: true
}));
}
}LWC — CSS
.success-button {
padding: 1rem 2rem;
border-radius: 0.75rem;
background: #10b981;
color: white;
font-weight: 600;
border: none;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
transition: all 0.3s ease;
}
.success-button:hover {
background: #059669;
}
.checkmark {
width: 1.5rem;
height: 1.5rem;
animation: checkmark-draw 0.5s ease;
}
@keyframes checkmark-draw {
from {
stroke-dasharray: 100;
stroke-dashoffset: 100;
}
to {
stroke-dasharray: 100;
stroke-dashoffset: 0;
}
}LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>Where Success Checkmark Button fits
- Form Completion
- Payment Success
- Task Completion
- Confirmation
Interaction states & animations
- Success
- Morph
- Checkmark
Topics
- #success
- #checkmark
- #complete
- #done
- #confirmation
- #morph
Accessibility notes
Announce success state to screen readers. Provide clear visual feedback.
Browser support
- All modern browsers