Skip to content

Bubble Messenger

A bubble grows around the button, a message floats inside it, the bubble drifts upward, pops with a satisfying burst, and a success ripple expands outward

Bubble Messenger

by FreeCsStyles Dev's

AnimatedStorybook
🌐🎨⚛️💚🅰️🔥☁️
#bubble#message#share#pop#ripple#animation#storybook#float

Embed this component

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

<iframe src="/embed/bubble-messenger-button" sandbox="allow-scripts" loading="lazy" title="Bubble Messenger" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Bubble Messenger, 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="bubble-btn"><span class="bubble-label">💬 Share</span><div class="bubble-container"><div class="bubble-sphere"></div><span class="bubble-msg">💬</span></div><div class="bubble-ripple"></div><span class="bubble-check">✓ Shared</span></button>
CSS
.bubble-btn{position:relative;width:180px;height:56px;border:none;border-radius:28px;background:linear-gradient(135deg,#7c3aed,#6d28d9);color:#fff;font-size:15px;font-weight:700;cursor:pointer;overflow:visible;font-family:system-ui,sans-serif;transition:all .3s}.bubble-btn:hover{transform:scale(1.04);box-shadow:0 8px 30px rgba(124,58,237,.4)}.bubble-btn:active{transform:scale(.97)}.bubble-label{position:relative;z-index:2;transition:opacity .3s}.bubble-container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;opacity:0;z-index:3}.bubble-sphere{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;border-radius:50%;background:rgba(255,255,255,.15);border:2px solid rgba(255,255,255,.3);backdrop-filter:blur(4px)}.bubble-msg{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:20px;opacity:0}.bubble-ripple{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:0;height:0;border-radius:50%;border:3px solid rgba(124,58,237,.4);opacity:0;z-index:1}.bubble-check{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:0;font-size:15px;color:#fff;z-index:6}.bubble-btn.is-growing .bubble-label{opacity:0}.bubble-btn.is-growing .bubble-container{opacity:1}.bubble-btn.is-growing .bubble-sphere{animation:bubble-grow .5s cubic-bezier(.34,1.56,.64,1) forwards}.bubble-btn.is-growing .bubble-msg{animation:bubble-msg-appear .3s ease .3s forwards}.bubble-btn.is-floating .bubble-sphere{animation:bubble-float 1s ease-in-out forwards}.bubble-btn.is-floating .bubble-msg{animation:bubble-msg-float 1s ease-in-out forwards}.bubble-btn.is-popping .bubble-sphere{animation:bubble-pop .3s ease forwards}.bubble-btn.is-popping .bubble-msg{animation:bubble-msg-pop .2s ease forwards}.bubble-btn.is-popping .bubble-ripple{animation:ripple-expand .6s ease forwards}.bubble-btn.is-done{background:linear-gradient(135deg,#16a34a,#15803d);border:2px solid rgba(255,255,255,.3)}.bubble-btn.is-done .bubble-label,.bubble-btn.is-done .bubble-container,.bubble-btn.is-done .bubble-ripple{opacity:0}.bubble-btn.is-done .bubble-check{opacity:1;animation:bubble-check-pop .5s cubic-bezier(.34,1.56,.64,1) forwards}@keyframes bubble-grow{0%{width:0;height:0;opacity:.5}100%{width:100px;height:100px;opacity:1}}@keyframes bubble-msg-appear{0%{opacity:0;transform:translate(-50%,-50%) scale(0)}100%{opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes bubble-float{0%{transform:translate(-50%,-50%) translateY(0)}100%{transform:translate(-50%,-50%) translateY(-60px)}}@keyframes bubble-msg-float{0%{transform:translate(-50%,-50%) translateY(0)}100%{transform:translate(-50%,-50%) translateY(-60px)}}@keyframes bubble-pop{0%{transform:translate(-50%,-50%) scale(1);opacity:1}50%{transform:translate(-50%,-50%) scale(1.3);opacity:.5}100%{transform:translate(-50%,-50%) scale(0);opacity:0}}@keyframes bubble-msg-pop{0%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(2)}}@keyframes ripple-expand{0%{width:0;height:0;opacity:1}100%{width:200px;height:200px;opacity:0}}@keyframes bubble-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-[28px] bg-gradient-to-br from-violet-600 to-violet-700 text-white text-[15px] font-bold cursor-pointer overflow-visible transition-all hover:scale-105 hover:shadow-lg active:scale-95 font-sans"><span class="relative z-10">💬 Share</span></button>
React
import { useState, useCallback } from 'react';

export function BubbleMessengerButton() {
  const [phase, setPhase] = useState('idle');
  const handleClick = useCallback(() => {
    if (phase !== 'idle') return;
    setPhase('growing');
    setTimeout(() => setPhase('floating'), 500);
    setTimeout(() => setPhase('popping'), 1500);
    setTimeout(() => setPhase('done'), 1800);
    setTimeout(() => setPhase('idle'), 3500);
  }, [phase]);
  const phaseClass = phase === 'idle' ? 'bubble-btn' : `bubble-btn is-${phase}`;
  return (
    <button onClick={handleClick} disabled={phase !== 'idle'} className={phaseClass} style={{position:'relative',width:180,height:56,border:'none',borderRadius:28,background:phase==='done'?'linear-gradient(135deg,#16a34a,#15803d)':'linear-gradient(135deg,#7c3aed,#6d28d9)',color:'#fff',fontSize:15,fontWeight:700,cursor:'pointer',overflow:'visible',fontFamily:'system-ui,sans-serif',transition:'all 0.3s'}}>
      {phase === 'idle' && <span className="bubble-label">💬 Share</span>}
      {['growing','floating','popping'].includes(phase) && <div className="bubble-container"><div className="bubble-sphere"></div><span className="bubble-msg">💬</span></div>}
      {phase === 'popping' && <div className="bubble-ripple"></div>}
      {phase === 'done' && <span className="bubble-check">✓ Shared</span>}
    </button>
  );
}
Vue
<template>
  <button
    :class="['bubble-btn', phase !== 'idle' ? 'is-' + phase : '']"
    @click="handleClick"
    :disabled="phase !== 'idle'"
  >
    <span v-if="phase === 'idle'" class="bubble-label">💬 Share</span>
    <div v-if="['growing','floating','popping'].includes(phase)" class="bubble-container">
      <div class="bubble-sphere"></div>
      <span class="bubble-msg">💬</span>
    </div>
    <div v-if="phase === 'popping'" class="bubble-ripple"></div>
    <span v-if="phase === 'done'" class="bubble-check">✓ Shared</span>
  </button>
</template>

<script setup>
import { ref } from 'vue';
const phase = ref('idle');
function handleClick() {
  if (phase.value !== 'idle') return;
  phase.value = 'growing';
  setTimeout(() => phase.value = 'floating', 500);
  setTimeout(() => phase.value = 'popping', 1500);
  setTimeout(() => phase.value = 'done', 1800);
  setTimeout(() => phase.value = 'idle', 3500);
}
</script>
Svelte
<script>
  let phase = 'idle';
  function handleClick() {
    if (phase !== 'idle') return;
    phase = 'growing';
    setTimeout(() => phase = 'floating', 500);
    setTimeout(() => phase = 'popping', 1500);
    setTimeout(() => phase = 'done', 1800);
    setTimeout(() => phase = 'idle', 35500);
  }
</script>
<button class="bubble-btn" class:is-done={phase === 'done'} on:click={handleClick} disabled={phase !== 'idle'}>
  {#if phase === 'idle'}<span class="bubble-label">💬 Share</span>{/if}
  {#if ['growing','floating','popping'].includes(phase)}<div class="bubble-container"><div class="bubble-sphere"></div><span class="bubble-msg">💬</span></div>{/if}
  {#if phase === 'popping'}<div class="bubble-ripple"></div>{/if}
  {#if phase === 'done'}<span class="bubble-check">✓ Shared</span>{/if}
</button>
Angular
import { Component } from '@angular/core';

@Component({
  selector: 'app-bubble-messenger-button',
  template: `<button [class]="'bubble-btn' + (phase !== 'idle' ? ' is-' + phase : '')" (click)="handleClick()" [disabled]="phase !== 'idle'">
    <span *ngIf="phase === 'idle'" class="bubble-label">💬 Share</span>
    <div *ngIf="isBubbleVisible" class="bubble-container">
      <div class="bubble-sphere"></div>
      <span class="bubble-msg">💬</span>
    </div>
    <div *ngIf="phase === 'popping'" class="bubble-ripple"></div>
    <span *ngIf="phase === 'done'" class="bubble-check">✓ Shared</span>
  </button>`,
  styles: [`.bubble-btn{position:relative;width:180px;height:56px;border:none;border-radius:28px;background:linear-gradient(135deg,#7c3aed,#6d28d9);color:#fff;font-size:15px;font-weight:700;cursor:pointer;overflow:visible;transition:all .3s}.is-done{background:linear-gradient(135deg,#16a34a,#15803d)}.bubble-label,.bubble-sphere,.bubble-msg,.bubble-ripple,.bubble-check{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}`]
})
export class BubbleMessengerButtonComponent {
  phase = 'idle';
  get isBubbleVisible() { return ['growing','floating','popping'].includes(this.phase); }
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'growing';
    setTimeout(() => this.phase = 'floating', 500);
    setTimeout(() => this.phase = 'popping', 1500);
    setTimeout(() => this.phase = 'done', 1800);
    setTimeout(() => this.phase = 'idle', 3500);
  }
}
LWC — HTML template
<template><button class="bubble-btn" onclick={handleClick} disabled={disabled}><span if:true={isIdle} class="bubble-label">💬 Share</span><div if:true={isBubbleVisible} class="bubble-container"><div class="bubble-sphere"></div><span class="bubble-msg">💬</span></div><div if:true={isPopping} class="bubble-ripple"></div><span if:true={isDone} class="bubble-check">✓ Shared</span></button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class BubbleMessengerButton extends LightningElement {
  phase = 'idle';
  get disabled() { return this.phase !== 'idle'; }
  get isIdle() { return this.phase === 'idle'; }
  get isBubbleVisible() { return ['growing','floating','popping'].includes(this.phase); }
  get isPopping() { return this.phase === 'popping'; }
  get isDone() { return this.phase === 'done'; }
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'growing';
    setTimeout(() => this.phase = 'floating', 500);
    setTimeout(() => this.phase = 'popping', 1500);
    setTimeout(() => this.phase = 'done', 1800);
    setTimeout(() => this.phase = 'idle', 3500);
  }
}
LWC — CSS
.bubble-btn{position:relative;width:180px;height:56px;border:none;border-radius:28px;background:linear-gradient(135deg,#7c3aed,#6d28d9);color:#fff;font-size:15px;font-weight:700;cursor:pointer;overflow:visible;font-family:system-ui,sans-serif;transition:all .3s}.bubble-btn.is-done{background:linear-gradient(135deg,#16a34a,#15803d)}.bubble-label,.bubble-sphere,.bubble-msg,.bubble-ripple,.bubble-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 Bubble Messenger fits

  • Share
  • Social Media
  • Chat
  • Comments

Interaction states & animations

  • Bubble Grow
  • Message Float
  • Bubble Pop
  • Ripple Expand

Topics

  • #bubble
  • #message
  • #share
  • #pop
  • #ripple
  • #animation
  • #storybook
  • #float

Accessibility notes

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

Browser support

  • All modern browsers