Paper Airplane Journey
Click to launch a paper airplane that flies away, then returns with a success checkmark — a satisfying send animation
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/paper-plane-button.
<iframe src="/embed/paper-plane-button" sandbox="allow-scripts" loading="lazy" title="Paper Airplane Journey" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Paper Airplane Journey, 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="btn-plane" id="planeBtn" onclick="triggerPlane()">
<span class="text">Send</span>
<svg class="plane-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="22" y1="2" x2="11" y2="13"></line>
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
</svg>
<svg class="check" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
</button>
<script>
function triggerPlane() {
const btn = document.getElementById('planeBtn');
if(btn.classList.contains('is-flying')) return;
btn.classList.add('is-flying');
setTimeout(() => { btn.classList.remove('is-flying'); btn.classList.add('is-success'); }, 1500);
setTimeout(() => btn.classList.remove('is-success'), 4000);
}
</script>CSS
.btn-plane { width: 160px; height: 50px; border-radius: 12px; border: none; background: #3b82f6; color: white; font-size: 16px; font-weight: 700; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.4s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 4px 15px rgba(59,130,246,0.4); font-family: system-ui, sans-serif; }
.btn-plane .text, .btn-plane .check { transition: all 0.3s ease; }
.btn-plane .check { position: absolute; opacity: 0; transform: scale(0); }
.btn-plane .plane-icon { position: absolute; left: 20px; opacity: 0; transition: all 0.3s ease; }
.btn-plane.is-flying { width: 50px; border-radius: 25px; background: #2563eb; color: transparent; }
.btn-plane.is-flying .text { opacity: 0; }
.btn-plane.is-flying .plane-icon { opacity: 1; animation: fly-away 1.5s forwards cubic-bezier(0.4,0,0.2,1); }
.btn-plane.is-success { background: #10b981; box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.btn-plane.is-success .check { opacity: 1; transform: scale(1); }
@keyframes fly-away { 0% { transform: translate(0,0) scale(1) rotate(0deg); } 30% { transform: translate(-10px,10px) scale(0.9) rotate(-10deg); } 100% { transform: translate(150px,-150px) scale(0.5) rotate(45deg); opacity: 0; } }Tailwind CSS
<button class="w-[160px] h-[50px] rounded-xl border-none bg-blue-500 text-white text-base font-bold cursor-pointer relative flex items-center justify-center overflow-hidden shadow-[0_4px_15px_rgba(59,130,246,0.4)] transition-all duration-400 [cubic-bezier(0.4,0,0.2,1)] [&.is-flying]:w-[50px] [&.is-flying]:rounded-full [&.is-flying]:bg-blue-600 [&.is-flying]:text-transparent [&.is-success]:bg-emerald-500 [&.is-success]:shadow-[0_4px_15px_rgba(16,185,129,0.4)]" id="tw-plane">
<span class="text">Send</span>
<svg class="plane-icon absolute left-5 opacity-0" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
<svg class="check absolute opacity-0 scale-0" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
</button>React
import React from 'react';
import { motion } from 'framer-motion';
function PaperPlaneButton() {
const [state, setState] = React.useState('idle');
const handleClick = () => {
if (state !== 'idle') return;
setState('flying');
setTimeout(() => setState('success'), 1500);
setTimeout(() => setState('idle'), 4500);
};
const f = state === 'flying';
const s = state === 'success';
return (
<motion.button onClick={handleClick}
style={{ width: f ? 50 : 160, height: 50, borderRadius: f ? 25 : 12, border: 'none', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'relative', fontSize: 16, fontWeight: 700, color: f ? 'transparent' : '#fff', background: s ? '#10b981' : '#3b82f6', boxShadow: s ? '0 4px 15px rgba(16,185,129,0.4)' : '0 4px 15px rgba(59,130,246,0.4)', transition: 'all 0.4s cubic-bezier(0.4,0,0.2,1)', overflow: 'hidden', fontFamily: 'system-ui, sans-serif' }}
whileTap={state === 'idle' ? { scale: 0.95 } : {}} disabled={state !== 'idle'}>
<motion.span style={{ position: 'absolute' }} animate={{ opacity: f ? 0 : 1 }}>{s ? 'Sent!' : 'Send'}</motion.span>
<motion.svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="2" style={{ position: 'absolute', left: 20 }}
animate={f ? { x: [0, 150], y: [0, -150], scale: [1, 0.5], rotate: [0, 45], opacity: [1, 0] } : { opacity: 0 }}
transition={{ duration: 1.5, ease: [0.4,0,0.2,1] }}>
<line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/>
</motion.svg>
<motion.svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" strokeWidth="3" style={{ position: 'absolute' }}
animate={s ? { scale: 1, opacity: 1 } : { scale: 0, opacity: 0 }}>
<polyline points="20 6 9 17 4 12"/>
</motion.svg>
</motion.button>
);
}Vue
<template>
<button class="btn-plane" :class="{ 'is-flying': state === 'flying', 'is-success': state === 'success' }" @click="handleClick" :disabled="state !== 'idle'">
<span class="text">{{ state === 'success' ? 'Sent!' : 'Send' }}</span>
<svg class="plane-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
<svg class="check" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
</button>
</template>
<script setup>
import { ref } from 'vue';
const state = ref('idle');
function handleClick() {
if (state.value !== 'idle') return;
state.value = 'flying';
setTimeout(() => state.value = 'success', 1500);
setTimeout(() => state.value = 'idle', 4500);
}
</script>
<style scoped>
.btn-plane { width: 160px; height: 50px; border-radius: 12px; border: none; background: #3b82f6; color: white; font-size: 16px; font-weight: 700; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.4s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 4px 15px rgba(59,130,246,0.4); }
.btn-plane .text, .btn-plane .check { transition: all 0.3s ease; }
.btn-plane .check { position: absolute; opacity: 0; transform: scale(0); }
.btn-plane .plane-icon { position: absolute; left: 20px; opacity: 0; transition: all 0.3s ease; }
.btn-plane.is-flying { width: 50px; border-radius: 25px; background: #2563eb; color: transparent; }
.btn-plane.is-flying .text { opacity: 0; }
.btn-plane.is-flying .plane-icon { opacity: 1; animation: fly-away 1.5s forwards cubic-bezier(0.4,0,0.2,1); }
.btn-plane.is-success { background: #10b981; box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.btn-plane.is-success .check { opacity: 1; transform: scale(1); }
@keyframes fly-away { 0% { transform: translate(0,0) scale(1) rotate(0deg); } 30% { transform: translate(-10px,10px) scale(0.9) rotate(-10deg); } 100% { transform: translate(150px,-150px) scale(0.5) rotate(45deg); opacity: 0; } }
</style>Svelte
<script>
let state = 'idle';
function handleClick() {
if (state !== 'idle') return;
state = 'flying';
setTimeout(() => state = 'success', 1500);
setTimeout(() => state = 'idle', 4500);
}
</script>
<button class="btn-plane" class:is-flying={state==='flying'} class:is-success={state==='success'} on:click={handleClick} disabled={state!=='idle'}>
<span class="text">{state==='success' ? 'Sent!' : 'Send'}</span>
<svg class="plane-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
<svg class="check" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
</button>
<style>
.btn-plane { width: 160px; height: 50px; border-radius: 12px; border: none; background: #3b82f6; color: white; font-size: 16px; font-weight: 700; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.4s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 4px 15px rgba(59,130,246,0.4); }
.btn-plane .text, .btn-plane .check { transition: all 0.3s ease; }
.btn-plane .check { position: absolute; opacity: 0; transform: scale(0); }
.btn-plane .plane-icon { position: absolute; left: 20px; opacity: 0; transition: all 0.3s ease; }
.btn-plane.is-flying { width: 50px; border-radius: 25px; background: #2563eb; color: transparent; }
.btn-plane.is-flying .text { opacity: 0; }
.btn-plane.is-flying .plane-icon { opacity: 1; animation: fly-away 1.5s forwards cubic-bezier(0.4,0,0.2,1); }
.btn-plane.is-success { background: #10b981; box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.btn-plane.is-success .check { opacity: 1; transform: scale(1); }
@keyframes fly-away { 0% { transform: translate(0,0) scale(1) rotate(0deg); } 30% { transform: translate(-10px,10px) scale(0.9) rotate(-10deg); } 100% { transform: translate(150px,-150px) scale(0.5) rotate(45deg); opacity: 0; } }
</style>Angular
import { Component } from '@angular/core';
@Component({
selector: 'app-paper-plane-button',
template: `<button class="btn-plane" [class.is-flying]="state==='flying'" [class.is-success]="state==='success'" (click)="handleClick()" [disabled]="state!=='idle'">
<span class="text">{{ state==='success' ? 'Sent!' : 'Send' }}</span>
<svg class="plane-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
<svg class="check" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
</button>`,
styles: [`.btn-plane { width: 160px; height: 50px; border-radius: 12px; border: none; background: #3b82f6; color: white; font-size: 16px; font-weight: 700; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.4s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 4px 15px rgba(59,130,246,0.4); }
.btn-plane .text, .btn-plane .check { transition: all 0.3s ease; }
.btn-plane .check { position: absolute; opacity: 0; transform: scale(0); }
.btn-plane .plane-icon { position: absolute; left: 20px; opacity: 0; transition: all 0.3s ease; }
.btn-plane.is-flying { width: 50px; border-radius: 25px; background: #2563eb; color: transparent; }
.btn-plane.is-flying .text { opacity: 0; }
.btn-plane.is-flying .plane-icon { opacity: 1; animation: fly-away 1.5s forwards cubic-bezier(0.4,0,0.2,1); }
.btn-plane.is-success { background: #10b981; box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.btn-plane.is-success .check { opacity: 1; transform: scale(1); }
@keyframes fly-away { 0% { transform: translate(0,0) scale(1) rotate(0deg); } 30% { transform: translate(-10px,10px) scale(0.9) rotate(-10deg); } 100% { transform: translate(150px,-150px) scale(0.5) rotate(45deg); opacity: 0; } }`]
})
export class PaperPlaneButtonComponent { state = 'idle'; handleClick() { if (this.state !== 'idle') return; this.state = 'flying'; setTimeout(() => this.state = 'success', 1500); setTimeout(() => this.state = 'idle', 4500); } }LWC — HTML template
<template><button class="btn-plane" onclick={handleClick} disabled={disabled}>
<span class="text">{label}</span>
<svg class="plane-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
<svg class="check" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>
</button></template>LWC — JavaScript
import { LightningElement } from 'lwc';
export default class PaperPlaneButton extends LightningElement {
state = 'idle';
get disabled() { return this.state !== 'idle'; }
get label() { return this.state === 'success' ? 'Sent!' : 'Send'; }
handleClick() {
if (this.state !== 'idle') return;
this.state = 'flying';
const btn = this.template.querySelector('button');
btn.classList.add('is-flying');
setTimeout(() => { btn.classList.remove('is-flying'); btn.classList.add('is-success'); this.state = 'success'; }, 1500);
setTimeout(() => { btn.classList.remove('is-success'); this.state = 'idle'; }, 4500);
}
}LWC — CSS
.btn-plane { width: 160px; height: 50px; border-radius: 12px; border: none; background: #3b82f6; color: white; font-size: 16px; font-weight: 700; cursor: pointer; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.4s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 4px 15px rgba(59,130,246,0.4); }
.btn-plane .text, .btn-plane .check { transition: all 0.3s ease; }
.btn-plane .check { position: absolute; opacity: 0; transform: scale(0); }
.btn-plane .plane-icon { position: absolute; left: 20px; opacity: 0; transition: all 0.3s ease; }
.btn-plane.is-flying { width: 50px; border-radius: 25px; background: #2563eb; color: transparent; }
.btn-plane.is-flying .text { opacity: 0; }
.btn-plane.is-flying .plane-icon { opacity: 1; animation: fly-away 1.5s forwards cubic-bezier(0.4,0,0.2,1); }
.btn-plane.is-success { background: #10b981; box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.btn-plane.is-success .check { opacity: 1; transform: scale(1); }
@keyframes fly-away { 0% { transform: translate(0,0) scale(1) rotate(0deg); } 30% { transform: translate(-10px,10px) scale(0.9) rotate(-10deg); } 100% { transform: translate(150px,-150px) scale(0.5) rotate(45deg); opacity: 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 Paper Airplane Journey fits
- Send Actions
- Submit Forms
- Messages
- Confirmations
Interaction states & animations
- Fly Away
- Shrink to Circle
- Success Reveal
- Checkmark
Topics
- #paper plane
- #send
- #fly
- #success
- #checkmark
- #journey
- #action
Accessibility notes
Button animates through 3 states — ensure screen readers announce state changes via aria-live region.
Browser support
- All modern browsers