Skip to content

Tiny Astronaut

A tiny astronaut waves, climbs into a rocket, a countdown sequence plays, blast off with thrust particles, and stars sparkle in the background

Tiny Astronaut

by FreeCsStyles Dev's

AnimatedStorybook
🌐🎨⚛️💚🅰️🔥☁️
#astronaut#rocket#space#launch#blast-off#animation#storybook#stars

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/tiny-astronaut-button.

<iframe src="/embed/tiny-astronaut-button" sandbox="allow-scripts" loading="lazy" title="Tiny Astronaut" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Tiny Astronaut, 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="astro-btn"><span class="astro-label">🚀 Launch</span><span class="astro-astronaut">🧑‍🚀</span><span class="astro-rocket">🚀</span><span class="astro-countdown"></span><div class="astro-thrust"></div><div class="astro-stars"><span>✦</span><span>✧</span><span>✦</span><span>✧</span></div><span class="astro-check">✓ Launched!</span></button>
CSS
.astro-btn{position:relative;width:180px;height:56px;border:none;border-radius:14px;background:linear-gradient(135deg,#0c1445,#1a1a5e);color:#93c5fd;font-size:15px;font-weight:700;cursor:pointer;overflow:hidden;font-family:system-ui,sans-serif;transition:all .3s}.astro-btn:hover{transform:scale(1.04);box-shadow:0 8px 30px rgba(26,26,94,.5)}.astro-btn:active{transform:scale(.97)}.astro-label{position:relative;z-index:2;transition:opacity .3s}.astro-astronaut{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);font-size:24px;opacity:0;z-index:5}.astro-rocket{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);font-size:26px;opacity:0;z-index:5}.astro-countdown{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:22px;font-weight:900;color:#fbbf24;opacity:0;z-index:6;text-shadow:0 0 10px rgba(251,191,36,.8)}.astro-thrust{position:absolute;bottom:-5px;left:50%;transform:translateX(-50%);width:40px;height:0;background:linear-gradient(to top,#f97316,#ef4444,#fbbf24);border-radius:0 0 50% 50%;opacity:0;z-index:1}.astro-stars{position:absolute;inset:0;pointer-events:none;z-index:1}.astro-stars span{position:absolute;color:#fbbf24;font-size:10px;opacity:0}.astro-stars span:nth-child(1){top:5px;left:10px}.astro-stars span:nth-child(2){top:8px;right:15px}.astro-stars span:nth-child(3){bottom:12px;left:25px}.astro-stars span:nth-child(4){bottom:5px;right:30px}.astro-check{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;font-size:15px;color:#93c5fd;z-index:6}.astro-btn.is-waving .astro-label{opacity:0}.astro-btn.is-waving .astro-astronaut{opacity:1;animation:astro-wave .6s ease forwards}.astro-btn.is-climbing .astro-astronaut{opacity:1;animation:astro-climb .4s ease forwards}.astro-btn.is-counting .astro-astronaut{opacity:0}.astro-btn.is-counting .astro-rocket{opacity:1;transform:translate(-50%,-50%) scale(1)}.astro-btn.is-counting .astro-countdown{opacity:1;animation:astro-count-pop .5s ease forwards}.astro-btn.is-launching .astro-rocket{animation:astro-blast-off 1s ease forwards}.astro-btn.is-launching .astro-thrust{opacity:1;animation:astro-thrust-flame .3s ease-in-out 3}.astro-btn.is-launching .astro-stars span{opacity:1;animation:astro-star-sparkle 1.5s ease-in-out infinite}.astro-btn.is-done{background:linear-gradient(135deg,#166534,#15803d);border:2px solid rgba(147,197,253,.3)}.astro-btn.is-done .astro-label,.astro-btn.is-done .astro-astronaut,.astro-btn.is-done .astro-rocket,.astro-btn.is-done .astro-countdown,.astro-btn.is-done .astro-thrust,.astro-btn.is-done .astro-stars span{opacity:0}.astro-btn.is-done .astro-check{opacity:1;animation:astro-check-pop .5s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes astro-wave{0%{transform:translate(-50%,-50%) scale(0) rotate(0)}50%{transform:translate(-50%,-50%) scale(1.1) rotate(-10deg)}100%{transform:translate(-50%,-50%) scale(1) rotate(0)}}@keyframes astro-climb{0%{transform:translate(-50%,-50%) scale(1)}100%{transform:translate(-50%,-120%) scale(.6);opacity:0}}@keyframes astro-count-pop{0%{transform:translate(-50%,-50%) scale(2);opacity:0}50%{opacity:1}100%{transform:translate(-50%,-50%) scale(1);opacity:1}}@keyframes astro-blast-off{0%{transform:translate(-50%,-50%) scale(1)}20%{transform:translate(-50%,-50%) scale(1.1)}100%{transform:translate(-50%,-200%) scale(.3);opacity:0}}@keyframes astro-thrust-flame{0%{height:0;opacity:.8}50%{height:30px;opacity:1}100%{height:0;opacity:0}}@keyframes astro-star-sparkle{0%,100%{opacity:.2;transform:scale(.6)}50%{opacity:1;transform:scale(1.3)}}@keyframes astro-check-pop{0%{transform:translate(-50%,-50%) scale(0)}60%{transform:translate(-50%,-50%) scale(1.2)}100%{transform:translate(-50%,-50%) scale(1);opacity:1}}
Tailwind CSS
<button class="relative w-[180px] h-[56px] rounded-[14px] bg-gradient-to-br from-[#0c1445] to-[#1a1a5e] text-blue-300 text-[15px] font-bold cursor-pointer overflow-hidden transition-all hover:scale-105 hover:shadow-lg active:scale-95 font-sans"><span class="relative z-10">🚀 Launch</span></button>
React
import { useState, useCallback } from 'react';

export function TinyAstronautButton() {
  const [phase, setPhase] = useState('idle');
  const [countdown, setCountdown] = useState(null);
  const handleClick = useCallback(() => {
    if (phase !== 'idle') return;
    setPhase('waving');
    setTimeout(() => setPhase('climbing'), 600);
    setTimeout(() => {
      setPhase('counting');
      let c = 3;
      setCountdown(c);
      const iv = setInterval(() => { c--; if (c <= 0) { clearInterval(iv); setCountdown(null); } else setCountdown(c); }, 500);
    }, 1000);
    setTimeout(() => setPhase('launching'), 2500);
    setTimeout(() => setPhase('done'), 3500);
    setTimeout(() => { setPhase('idle'); setCountdown(null); }, 5000);
  }, [phase]);
  const phaseClass = phase === 'idle' ? 'astro-btn' : `astro-btn is-${phase}`;
  return (
    <button onClick={handleClick} disabled={phase !== 'idle'} className={phaseClass} style={{position:'relative',width:180,height:56,border:'none',borderRadius:14,background:phase==='done'?'linear-gradient(135deg,#166534,#15803d)':'linear-gradient(135deg,#0c1445,#1a1a5e)',color:'#93c5fd',fontSize:15,fontWeight:700,cursor:'pointer',overflow:'hidden',fontFamily:'system-ui,sans-serif',transition:'all 0.3s'}}>
      {phase === 'idle' && <span className="astro-label">🚀 Launch</span>}
      {(phase === 'waving' || phase === 'climbing') && <span className="astro-astronaut">🧑‍🚀</span>}
      {(phase === 'counting' || phase === 'launching') && <span className="astro-rocket">🚀</span>}
      {phase === 'counting' && <span className="astro-countdown">{countdown}</span>}
      {phase === 'launching' && <div className="astro-thrust"></div>}
      {phase === 'done' && <span className="astro-check">✓ Launched!</span>}
    </button>
  );
}
Vue
<template>
  <button
    :class="['astro-btn', phase !== 'idle' ? 'is-' + phase : '']"
    @click="handleClick"
    :disabled="phase !== 'idle'"
  >
    <span v-if="phase === 'idle'" class="astro-label">🚀 Launch</span>
    <span v-if="phase === 'waving' || phase === 'climbing'" class="astro-astronaut">🧑‍🚀</span>
    <span v-if="phase === 'counting' || phase === 'launching'" class="astro-rocket">🚀</span>
    <span v-if="phase === 'counting'" class="astro-countdown">{{ countdown }}</span>
    <span v-if="phase === 'done'" class="astro-check">✓ Launched!</span>
  </button>
</template>

<script setup>
import { ref } from 'vue';
const phase = ref('idle');
const countdown = ref(null);
function handleClick() {
  if (phase.value !== 'idle') return;
  phase.value = 'waving';
  setTimeout(() => phase.value = 'climbing', 600);
  setTimeout(() => {
    phase.value = 'counting';
    let c = 3;
    countdown.value = c;
    const iv = setInterval(() => { c--; if (c <= 0) { clearInterval(iv); countdown.value = null; } else countdown.value = c; }, 500);
  }, 1000);
  setTimeout(() => phase.value = 'launching', 2500);
  setTimeout(() => phase.value = 'done', 3500);
  setTimeout(() => { phase.value = 'idle'; countdown.value = null; }, 5000);
}
</script>
Svelte
<script>
  let phase = 'idle';
  let countdown = null;
  function handleClick() {
    if (phase !== 'idle') return;
    phase = 'waving';
    setTimeout(() => phase = 'climbing', 600);
    setTimeout(() => {
      phase = 'counting';
      let c = 3;
      countdown = c;
      const iv = setInterval(() => { c--; if (c <= 0) { clearInterval(iv); countdown = null; } else countdown = c; }, 500);
    }, 1000);
    setTimeout(() => phase = 'launching', 2500);
    setTimeout(() => phase = 'done', 3500);
    setTimeout(() => { phase = 'idle'; countdown = null; }, 5000);
  }
</script>
<button class="astro-btn" class:is-done={phase === 'done'} on:click={handleClick} disabled={phase !== 'idle'}>
  {#if phase === 'idle'}<span class="astro-label">🚀 Launch</span>{/if}
  {#if phase === 'waving' || phase === 'climbing'}<span class="astro-astronaut">🧑‍🚀</span>{/if}
  {#if phase === 'counting' || phase === 'launching'}<span class="astro-rocket">🚀</span>{/if}
  {#if phase === 'counting'}<span class="astro-countdown">{countdown}</span>{/if}
  {#if phase === 'done'}<span class="astro-check">✓ Launched!</span>{/if}
</button>
Angular
import { Component } from '@angular/core';

@Component({
  selector: 'app-tiny-astronaut-button',
  template: `<button [class]="'astro-btn' + (phase !== 'idle' ? ' is-' + phase : '')" (click)="handleClick()" [disabled]="phase !== 'idle'">
    <span *ngIf="phase === 'idle'" class="astro-label">🚀 Launch</span>
    <span *ngIf="phase === 'waving' || phase === 'climbing'" class="astro-astronaut">🧑‍🚀</span>
    <span *ngIf="phase === 'counting' || phase === 'launching'" class="astro-rocket">🚀</span>
    <span *ngIf="phase === 'counting'" class="astro-countdown">{{ countdown }}</span>
    <span *ngIf="phase === 'done'" class="astro-check">✓ Launched!</span>
  </button>`,
  styles: [`.astro-btn{position:relative;width:180px;height:56px;border:none;border-radius:14px;background:linear-gradient(135deg,#0c1445,#1a1a5e);color:#93c5fd;font-size:15px;font-weight:700;cursor:pointer;overflow:hidden;transition:all .3s}.is-done{background:linear-gradient(135deg,#166534,#15803d)}.astro-label,.astro-astronaut,.astro-rocket,.astro-countdown,.astro-check{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}`]
})
export class TinyAstronautButtonComponent {
  phase = 'idle';
  countdown = null;
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'waving';
    setTimeout(() => this.phase = 'climbing', 600);
    setTimeout(() => {
      this.phase = 'counting';
      let c = 3;
      this.countdown = c;
      const iv = setInterval(() => { c--; if (c <= 0) { clearInterval(iv); this.countdown = null; } else this.countdown = c; }, 500);
    }, 1000);
    setTimeout(() => this.phase = 'launching', 2500);
    setTimeout(() => this.phase = 'done', 3500);
    setTimeout(() => { this.phase = 'idle'; this.countdown = null; }, 5000);
  }
}
LWC — HTML template
<template><button class="astro-btn" onclick={handleClick} disabled={disabled}><span if:true={isIdle} class="astro-label">🚀 Launch</span><span if:true={isAstronautVisible} class="astro-astronaut">🧑‍🚀</span><span if:true={isRocketVisible} class="astro-rocket">🚀</span><span if:true={isCounting} class="astro-countdown">{countdown}</span><span if:true={isDone} class="astro-check">✓ Launched!</span></button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class TinyAstronautButton extends LightningElement {
  phase = 'idle';
  countdown = null;
  get disabled() { return this.phase !== 'idle'; }
  get isIdle() { return this.phase === 'idle'; }
  get isAstronautVisible() { return this.phase === 'waving' || this.phase === 'climbing'; }
  get isRocketVisible() { return this.phase === 'counting' || this.phase === 'launching'; }
  get isCounting() { return this.phase === 'counting'; }
  get isDone() { return this.phase === 'done'; }
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'waving';
    setTimeout(() => this.phase = 'climbing', 600);
    setTimeout(() => {
      this.phase = 'counting';
      let c = 3;
      this.countdown = c;
      const iv = setInterval(() => { c--; if (c <= 0) { clearInterval(iv); this.countdown = null; } else this.countdown = c; }, 500);
    }, 1000);
    setTimeout(() => this.phase = 'launching', 2500);
    setTimeout(() => this.phase = 'done', 3500);
    setTimeout(() => { this.phase = 'idle'; this.countdown = null; }, 5000);
  }
}
LWC — CSS
.astro-btn{position:relative;width:180px;height:56px;border:none;border-radius:14px;background:linear-gradient(135deg,#0c1445,#1a1a5e);color:#93c5fd;font-size:15px;font-weight:700;cursor:pointer;overflow:hidden;font-family:system-ui,sans-serif;transition:all .3s}.astro-btn.is-done{background:linear-gradient(135deg,#166534,#15803d)}.astro-label,.astro-astronaut,.astro-rocket,.astro-countdown,.astro-check{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}
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 Tiny Astronaut fits

  • Launch
  • Deploy
  • Publish
  • Go Live

Interaction states & animations

  • Astronaut Wave
  • Rocket Climb
  • Countdown
  • Blast Off
  • Star Sparkle

Topics

  • #astronaut
  • #rocket
  • #space
  • #launch
  • #blast-off
  • #animation
  • #storybook
  • #stars

Accessibility notes

Animation is decorative. Button text remains readable. Respect reduced-motion preference.

Browser support

  • All modern browsers