# Comic speech balloon tooltip

> A halftone comic panel where the character pops a thick outlined speech balloon with an action burst behind it.

- Category: [Tooltips](https://library.aimran.es/components/tooltips)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-tip-comic-balloon
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

A comic panel with a halftone dot pattern, a yellow caption box and a small character drawn in SVG. Hover or focus the character and a speech balloon with a heavy black outline pops out with a springy overshoot, while a burst of action lines spins in behind. It brings humor to onboarding, empty states, mascots and playful marketing pages.

The main color tints the dots and the shirt, the second fills the panel. Write the line in a short, spoken tone, and swap the SVG for your own mascot to keep the same balloon and burst.

## Code

### HTML

```html
<div class="uvq08-cmc"><div class="pn"><span class="cap">Meanwhile, at the office…</span><span class="wr pk"><button type="button" class="hr" aria-label="Character" aria-describedby="uvq08-cmc-t"><svg viewBox="0 0 80 80" aria-hidden="true"><path class="sh" d="M12 80c2-16 12-24 28-24s26 8 28 24z"/><circle class="fa" cx="40" cy="34" r="17"/><path class="ha" d="M23 32c0-11 8-17 18-17s16 6 17 15c-6-4-13-5-20-3-6 1-10 3-15 5z"/><circle cx="34" cy="36" r="2.2"/><circle cx="46" cy="36" r="2.2"/><path class="mo" d="M35 44q5 4 10 0"/></svg></button><span class="bl" role="tooltip" id="uvq08-cmc-t">Has anyone seen my stapler?</span></span></div></div>
```

### CSS

```css
.uvq08-cmc {
  --c1: #e63946;
  --c2: #ffd166;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq08-cmc {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  padding: .3em;
}

.uvq08-cmc .pn {
  position: relative;
  width: 15em;
  height: 12em;
  border: .2em solid #111;
  background: radial-gradient(circle,color-mix(in srgb,var(--c1) 50%,transparent) 28%,transparent 32%) 0 0/.55em .55em,var(--c2);
  box-shadow: .35em .35em 0 #111;
  overflow: hidden;
}

.uvq08-cmc .cap {
  position: absolute;
  left: .5em;
  top: .5em;
  z-index: 2;
  max-width: 13em;
  padding: .3em .5em;
  border: .14em solid #111;
  font: 800 .62em/1.2 "Comic Sans MS","Chalkboard SE","Comic Neue",ui-rounded,system-ui,sans-serif;
  text-transform: uppercase;
  color: #111;
  background: #fff4c2;
}

.uvq08-cmc .wr {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
}

.uvq08-cmc .hr {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: block;
  width: 5.4em;
  height: 5.4em;
  isolation: isolate;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-cmc .hr::before {
  content: "";
  position: absolute;
  inset: -1.6em;
  z-index: -1;
  border-radius: 50%;
  background: repeating-conic-gradient(#fff 0 5deg,transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side,transparent 35%,#000 36%,transparent 100%);
  mask: radial-gradient(closest-side,transparent 35%,#000 36%,transparent 100%);
  opacity: 0;
  transform: scale(.5) rotate(-20deg);
  transition: all calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-cmc .hr svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #111;
  stroke: #111;
  stroke-width: 3;
}

.uvq08-cmc .hr .sh {
  fill: var(--c1);
}

.uvq08-cmc .hr .fa {
  fill: #f6d2b0;
}

.uvq08-cmc .hr .ha {
  stroke: none;
}

.uvq08-cmc .hr .mo {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.uvq08-cmc .hr:hover {
  transform: translateY(-.15em);
}

.uvq08-cmc .hr:active {
  transform: scale(.95);
}

.uvq08-cmc .hr:focus-visible {
  outline: .2em solid #111;
  outline-offset: -.1em;
  border-radius: .5em;
}

.uvq08-cmc .bl {
  position: absolute;
  left: 30%;
  bottom: calc(100% + .4em);
  display: block;
  width: 9em;
  padding: .9em 1em;
  border: .18em solid #111;
  border-radius: 50%;
  font: 800 .78em/1.2 "Comic Sans MS","Chalkboard SE","Comic Neue",ui-rounded,system-ui,sans-serif;
  text-align: center;
  text-transform: uppercase;
  color: #111;
  background: #fff;
  transform-origin: 15% 120%;
  transform: scale(.2) rotate(-12deg);
  opacity: 0;
  visibility: hidden;
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),visibility 0s calc(0.2s / var(--k));
}

.uvq08-cmc .bl::before,.uvq08-cmc .bl::after {
  content: "";
  position: absolute;
  top: 100%;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.uvq08-cmc .bl::before {
  left: 18%;
  border-width: 1.3em .2em 0 1em;
  margin-top: -.05em;
}

.uvq08-cmc .bl::after {
  left: calc(18% + .26em);
  border-width: .98em .1em 0 .66em;
  border-top-color: #fff;
  margin-top: -.32em;
}

.uvq08-cmc .wr:hover .bl,.uvq08-cmc .wr:focus-within .bl,.uvq08-cmc .wr.pk .bl {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-cmc .wr:hover .hr::before,.uvq08-cmc .wr:focus-within .hr::before,.uvq08-cmc .wr.pk .hr::before {
  opacity: .9;
  transform: none;
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-cmc,.uvq08-cmc *,.uvq08-cmc *::before,.uvq08-cmc *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
```

### JavaScript

```js
document.querySelectorAll(".uvq08-cmc").forEach(el => {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
});
```

### React

```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq08-cmc {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  padding: .3em;
}

.uvq08-cmc .pn {
  position: relative;
  width: 15em;
  height: 12em;
  border: .2em solid #111;
  background: radial-gradient(circle,color-mix(in srgb,var(--c1) 50%,transparent) 28%,transparent 32%) 0 0/.55em .55em,var(--c2);
  box-shadow: .35em .35em 0 #111;
  overflow: hidden;
}

.uvq08-cmc .cap {
  position: absolute;
  left: .5em;
  top: .5em;
  z-index: 2;
  max-width: 13em;
  padding: .3em .5em;
  border: .14em solid #111;
  font: 800 .62em/1.2 "Comic Sans MS","Chalkboard SE","Comic Neue",ui-rounded,system-ui,sans-serif;
  text-transform: uppercase;
  color: #111;
  background: #fff4c2;
}

.uvq08-cmc .wr {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
}

.uvq08-cmc .hr {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: block;
  width: 5.4em;
  height: 5.4em;
  isolation: isolate;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-cmc .hr::before {
  content: "";
  position: absolute;
  inset: -1.6em;
  z-index: -1;
  border-radius: 50%;
  background: repeating-conic-gradient(#fff 0 5deg,transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side,transparent 35%,#000 36%,transparent 100%);
  mask: radial-gradient(closest-side,transparent 35%,#000 36%,transparent 100%);
  opacity: 0;
  transform: scale(.5) rotate(-20deg);
  transition: all calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-cmc .hr svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #111;
  stroke: #111;
  stroke-width: 3;
}

.uvq08-cmc .hr .sh {
  fill: var(--c1);
}

.uvq08-cmc .hr .fa {
  fill: #f6d2b0;
}

.uvq08-cmc .hr .ha {
  stroke: none;
}

.uvq08-cmc .hr .mo {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.uvq08-cmc .hr:hover {
  transform: translateY(-.15em);
}

.uvq08-cmc .hr:active {
  transform: scale(.95);
}

.uvq08-cmc .hr:focus-visible {
  outline: .2em solid #111;
  outline-offset: -.1em;
  border-radius: .5em;
}

.uvq08-cmc .bl {
  position: absolute;
  left: 30%;
  bottom: calc(100% + .4em);
  display: block;
  width: 9em;
  padding: .9em 1em;
  border: .18em solid #111;
  border-radius: 50%;
  font: 800 .78em/1.2 "Comic Sans MS","Chalkboard SE","Comic Neue",ui-rounded,system-ui,sans-serif;
  text-align: center;
  text-transform: uppercase;
  color: #111;
  background: #fff;
  transform-origin: 15% 120%;
  transform: scale(.2) rotate(-12deg);
  opacity: 0;
  visibility: hidden;
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),visibility 0s calc(0.2s / var(--k));
}

.uvq08-cmc .bl::before,.uvq08-cmc .bl::after {
  content: "";
  position: absolute;
  top: 100%;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.uvq08-cmc .bl::before {
  left: 18%;
  border-width: 1.3em .2em 0 1em;
  margin-top: -.05em;
}

.uvq08-cmc .bl::after {
  left: calc(18% + .26em);
  border-width: .98em .1em 0 .66em;
  border-top-color: #fff;
  margin-top: -.32em;
}

.uvq08-cmc .wr:hover .bl,.uvq08-cmc .wr:focus-within .bl,.uvq08-cmc .wr.pk .bl {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-cmc .wr:hover .hr::before,.uvq08-cmc .wr:focus-within .hr::before,.uvq08-cmc .wr.pk .hr::before {
  opacity: .9;
  transform: none;
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-cmc,.uvq08-cmc *,.uvq08-cmc *::before,.uvq08-cmc *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
}

export default function TipComicBalloon() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e63946",
          "--c2": "#ffd166",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-cmc"><div className="pn"><span className="cap">Meanwhile, at the office…</span><span className="wr pk"><button type="button" className="hr" aria-label="Character" aria-describedby="uvq08-cmc-t"><svg viewBox="0 0 80 80" aria-hidden="true"><path className="sh" d="M12 80c2-16 12-24 28-24s26 8 28 24z" /><circle className="fa" cx="40" cy="34" r="17" /><path className="ha" d="M23 32c0-11 8-17 18-17s16 6 17 15c-6-4-13-5-20-3-6 1-10 3-15 5z" /><circle cx="34" cy="36" r="2.2" /><circle cx="46" cy="36" r="2.2" /><path className="mo" d="M35 44q5 4 10 0" /></svg></button><span className="bl" role="tooltip" id="uvq08-cmc-t">Has anyone seen my stapler?</span></span></div></div>
      </div>
    </>
  );
}
```

## Prompt for AI assistants

Paste this into ChatGPT, Claude, Cursor, v0 or Lovable to adapt the block to your stack (Tailwind, Vue, Svelte…):

````text
I want to add the “Comic speech balloon tooltip” block (Tooltips) from AIMRAN Library to my project.

## What it is
A halftone comic panel where the character pops a thick outlined speech balloon with an action burst behind it.

## Chosen settings
- Main color: #e63946
- Secondary color: #ffd166
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "¿Alguien ha visto mi grapadora?"

## What I need
1. Add it to my project with the same look and animation as the reference code: same sizes, colours, radii, shadows, timings and easing.
2. It is built with plain HTML and CSS (the reference wraps it in a React component with its CSS). If my project uses something else (Vue, Svelte, Astro, plain HTML…), translate it without losing any behaviour. If I use Tailwind, turn the styles into classes; if not, keep the CSS in its own file.
3. Expose the settings above as props (or CSS variables) with those values as defaults.
4. Make it work well on phones: nothing that depends only on hover, touch targets of at least 44 px and no overflow on 320 px screens.
5. Make it look right in light and dark mode.
6. Keep it accessible: semantic HTML, roles and aria-* where needed, visible focus and keyboard support.
7. Respect prefers-reduced-motion: with reduced motion, no big animations but the same end result.

## Reference code
```tsx
// @ts-nocheck: setup() es JavaScript del DOM sin tipos, el mismo de la pestaña JS.
import { useEffect, useRef, type CSSProperties } from "react";

const css = `
.uvq08-cmc {
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Inter",system-ui,sans-serif;
  font-size: var(--s);
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
  padding: .3em;
}

.uvq08-cmc .pn {
  position: relative;
  width: 15em;
  height: 12em;
  border: .2em solid #111;
  background: radial-gradient(circle,color-mix(in srgb,var(--c1) 50%,transparent) 28%,transparent 32%) 0 0/.55em .55em,var(--c2);
  box-shadow: .35em .35em 0 #111;
  overflow: hidden;
}

.uvq08-cmc .cap {
  position: absolute;
  left: .5em;
  top: .5em;
  z-index: 2;
  max-width: 13em;
  padding: .3em .5em;
  border: .14em solid #111;
  font: 800 .62em/1.2 "Comic Sans MS","Chalkboard SE","Comic Neue",ui-rounded,system-ui,sans-serif;
  text-transform: uppercase;
  color: #111;
  background: #fff4c2;
}

.uvq08-cmc .wr {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
}

.uvq08-cmc .hr {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: block;
  width: 5.4em;
  height: 5.4em;
  isolation: isolate;
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-cmc .hr::before {
  content: "";
  position: absolute;
  inset: -1.6em;
  z-index: -1;
  border-radius: 50%;
  background: repeating-conic-gradient(#fff 0 5deg,transparent 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side,transparent 35%,#000 36%,transparent 100%);
  mask: radial-gradient(closest-side,transparent 35%,#000 36%,transparent 100%);
  opacity: 0;
  transform: scale(.5) rotate(-20deg);
  transition: all calc(0.4s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq08-cmc .hr svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: #111;
  stroke: #111;
  stroke-width: 3;
}

.uvq08-cmc .hr .sh {
  fill: var(--c1);
}

.uvq08-cmc .hr .fa {
  fill: #f6d2b0;
}

.uvq08-cmc .hr .ha {
  stroke: none;
}

.uvq08-cmc .hr .mo {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.uvq08-cmc .hr:hover {
  transform: translateY(-.15em);
}

.uvq08-cmc .hr:active {
  transform: scale(.95);
}

.uvq08-cmc .hr:focus-visible {
  outline: .2em solid #111;
  outline-offset: -.1em;
  border-radius: .5em;
}

.uvq08-cmc .bl {
  position: absolute;
  left: 30%;
  bottom: calc(100% + .4em);
  display: block;
  width: 9em;
  padding: .9em 1em;
  border: .18em solid #111;
  border-radius: 50%;
  font: 800 .78em/1.2 "Comic Sans MS","Chalkboard SE","Comic Neue",ui-rounded,system-ui,sans-serif;
  text-align: center;
  text-transform: uppercase;
  color: #111;
  background: #fff;
  transform-origin: 15% 120%;
  transform: scale(.2) rotate(-12deg);
  opacity: 0;
  visibility: hidden;
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1),opacity calc(0.15s / var(--k)) cubic-bezier(.25,.1,.25,1),visibility 0s calc(0.2s / var(--k));
}

.uvq08-cmc .bl::before,.uvq08-cmc .bl::after {
  content: "";
  position: absolute;
  top: 100%;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.uvq08-cmc .bl::before {
  left: 18%;
  border-width: 1.3em .2em 0 1em;
  margin-top: -.05em;
}

.uvq08-cmc .bl::after {
  left: calc(18% + .26em);
  border-width: .98em .1em 0 .66em;
  border-top-color: #fff;
  margin-top: -.32em;
}

.uvq08-cmc .wr:hover .bl,.uvq08-cmc .wr:focus-within .bl,.uvq08-cmc .wr.pk .bl {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1),opacity calc(0.1s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq08-cmc .wr:hover .hr::before,.uvq08-cmc .wr:focus-within .hr::before,.uvq08-cmc .wr.pk .hr::before {
  opacity: .9;
  transform: none;
}

@media (prefers-reduced-motion:reduce) {
  .uvq08-cmc,.uvq08-cmc *,.uvq08-cmc *::before,.uvq08-cmc *::after {
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
`;

// Interacción en JavaScript del DOM: la misma que en la pestaña JS.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setup(el: any) {
  const unpk=()=>{el.classList.remove("pk");el.querySelectorAll(".pk").forEach(x=>x.classList.remove("pk"))};el.addEventListener("pointerover",unpk,{once:true});el.addEventListener("focusin",unpk,{once:true});
}

export default function TipComicBalloon() {
  const ref = useRef<HTMLDivElement>(null);

  useEffect(() => {
    const el = ref.current?.firstElementChild;
    return el ? setup(el) : undefined;
  }, []);

  return (
    <>
      <style>{css}</style>
      <div
        ref={ref} style={{
          "--c1": "#e63946",
          "--c2": "#ffd166",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq08-cmc"><div className="pn"><span className="cap">Meanwhile, at the office…</span><span className="wr pk"><button type="button" className="hr" aria-label="Character" aria-describedby="uvq08-cmc-t"><svg viewBox="0 0 80 80" aria-hidden="true"><path className="sh" d="M12 80c2-16 12-24 28-24s26 8 28 24z" /><circle className="fa" cx="40" cy="34" r="17" /><path className="ha" d="M23 32c0-11 8-17 18-17s16 6 17 15c-6-4-13-5-20-3-6 1-10 3-15 5z" /><circle cx="34" cy="36" r="2.2" /><circle cx="46" cy="36" r="2.2" /><path className="mo" d="M35 44q5 4 10 0" /></svg></button><span className="bl" role="tooltip" id="uvq08-cmc-t">Has anyone seen my stapler?</span></span></div></div>
      </div>
    </>
  );
}
```

Give me the complete final code, ready to paste, and tell me in one line where to put it in my project.
````
