# Was this helpful thumbs

> The chosen thumb hops while the other shrinks away; yes brings confetti, no unfolds a field to say what to improve.

- Category: [Microinteractions](https://library.aimran.es/components/microinteractions)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-mi27-helpful-thumbs
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

Help centers and documentation end articles with a quick yes or no question, and this block makes the answer feel acknowledged. Choosing yes bounces the thumb, bursts a little confetti and thanks the reader; choosing no tilts the thumb down and unfolds a text field to explain what was missing. The unused button collapses smoothly in both cases.

The main color marks a positive answer and the secondary one a negative answer and its form. The question is the editable text. Send the choice and the comment to your analytics in the submit handler, and keep Change answer for people who misclick.

## Code

### HTML

```html
<div class="uvq15-thm"><p class="q">Was this article helpful?</p><div class="ch"><button type="button" class="y" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM7 10l4-7a2.5 2.5 0 0 1 3 2.5V9h5.5a2 2 0 0 1 2 2.3l-1.2 7.5a2.5 2.5 0 0 1-2.5 2.2H7"/></svg><span>Yes</span><span class="cf" aria-hidden="true"><i style="--a:0deg"></i><i style="--a:51deg"></i><i style="--a:102deg"></i><i style="--a:153deg"></i><i style="--a:204deg"></i><i style="--a:255deg"></i><i style="--a:306deg"></i></span></button><button type="button" class="n" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1zM17 14l-4 7a2.5 2.5 0 0 1-3-2.5V15H4.5a2 2 0 0 1-2-2.3l1.2-7.5A2.5 2.5 0 0 1 6.2 3H17"/></svg><span>No</span></button></div><div class="mo"><form class="fm"><textarea rows="2" placeholder="What can we improve?" aria-label="What can we improve?"></textarea><button type="submit" class="sd">Send</button></form></div><p class="ty" aria-live="polite"></p><button type="button" class="rs" hidden>Change answer</button></div>
```

### CSS

```css
.uvq15-thm {
  --c1: #16a34a;
  --c2: #e11d48;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq15-thm {
  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;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  display: grid;
  justify-items: center;
  width: 18em;
  padding: 1.1em 1.1em .9em;
  text-align: center;
}

.uvq15-thm .q {
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq15-thm .ch {
  display: flex;
  justify-content: center;
  gap: .6em;
}

.uvq15-thm .ch button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: flex;
  align-items: center;
  gap: .45em;
  max-width: 8em;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  transition: max-width calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1),padding calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),transform .15s cubic-bezier(.25,.1,.25,1);
}

.uvq15-thm .ch button:hover {
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-thm .ch button:active {
  transform: scale(.95);
}

.uvq15-thm .ch button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-thm .ch svg {
  flex: none;
  width: 1.3em;
  height: 1.3em;
}

.uvq15-thm .y[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
  box-shadow: none;
}

.uvq15-thm .n[aria-pressed="true"] {
  color: #fff;
  background: var(--c2);
  box-shadow: none;
}

.uvq15-thm.yes .n,.uvq15-thm.no .y {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.uvq15-thm.yes .ch,.uvq15-thm.no .ch {
  gap: 0;
}

.uvq15-thm.yes .y svg {
  animation: uvq15-thm-u calc(0.6s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq15-thm.no .n svg {
  animation: uvq15-thm-d calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-thm-u {
  40% {
    transform: translateY(-.3em) rotate(-22deg) scale(1.25);
  }
}

@keyframes uvq15-thm-d {
  25% {
    transform: rotate(14deg) translateY(.15em);
  }
  50% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

.uvq15-thm .cf {
  position: absolute;
  left: 1.75em;
  top: 50%;
  pointer-events: none;
}

.uvq15-thm .cf i {
  position: absolute;
  width: .35em;
  height: .35em;
  margin: -.175em;
  border-radius: .1em;
  background: var(--c1);
  opacity: 0;
}

.uvq15-thm .cf i:nth-child(3n+1) {
  background: #facc15;
}

.uvq15-thm .cf i:nth-child(3n+2) {
  background: #38bdf8;
}

.uvq15-thm.yes .cf i {
  animation: uvq15-thm-c calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq15-thm-c {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(-.4em);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-2.6em) rotate(160deg);
  }
}

.uvq15-thm .mo {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  transition: grid-template-rows calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq15-thm.no:not(.sent) .mo {
  grid-template-rows: 1fr;
}

.uvq15-thm .fm {
  display: grid;
  gap: .5em;
  min-height: 0;
  overflow: hidden;
}

.uvq15-thm textarea {
  margin-top: .8em;
  padding: .6em .8em;
  border: 0;
  border-radius: .7em;
  resize: none;
  font: inherit;
  font-size: .85em;
  color: inherit;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  outline: 0;
}

.uvq15-thm textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c2);
}

.uvq15-thm .sd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  justify-self: end;
  margin: 0 .1em .2em;
  padding: .5em 1em;
  border-radius: .6em;
  font-size: .85em;
  font-weight: 700;
  color: #fff;
  background: var(--c2);
}

.uvq15-thm .sd:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-thm .ty {
  min-height: 1.3em;
  margin: .6em 0 0;
  font-size: .85em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-thm .ty:not(:empty) {
  animation: uvq15-thm-t calc(0.4s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq15-thm-t {
  from {
    opacity: 0;
    transform: translateY(.4em);
  }
}

.uvq15-thm .rs {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .2em;
  font-size: .72em;
  text-decoration: underline;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-thm .rs[hidden] {
  display: none;
}

.uvq15-thm .rs:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

### JavaScript

```js
document.querySelectorAll(".uvq15-thm").forEach(el => {
  const y=el.querySelector(".y"),n=el.querySelector(".n"),ty=el.querySelector(".ty"),mo=el.querySelector(".mo"),fm=el.querySelector(".fm"),ta=el.querySelector("textarea"),rs=el.querySelector(".rs");let tm=0;mo.inert=true;
const pick=v=>{if(el.classList.contains("yes")||el.classList.contains("no"))return;el.classList.add(v?"yes":"no");(v?y:n).setAttribute("aria-pressed","true");const o=v?n:y;o.tabIndex=-1;o.setAttribute("aria-hidden","true");
if(v){ty.textContent="Thanks for your feedback";rs.hidden=false}else{mo.inert=false;tm=setTimeout(()=>ta.focus(),350)}};
y.addEventListener("click",()=>pick(true));n.addEventListener("click",()=>pick(false));
fm.addEventListener("submit",e=>{e.preventDefault();el.classList.add("sent");mo.inert=true;ty.textContent="Thanks, we’ll look into it";rs.hidden=false;rs.focus()});
rs.addEventListener("click",()=>{el.classList.remove("yes","no","sent");[y,n].forEach(b=>{b.setAttribute("aria-pressed","false");b.tabIndex=0;b.removeAttribute("aria-hidden")});mo.inert=true;ty.textContent="";ta.value="";rs.hidden=true;y.focus()});return()=>clearTimeout(tm)
});
```

### 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 = `
.uvq15-thm {
  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;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  display: grid;
  justify-items: center;
  width: 18em;
  padding: 1.1em 1.1em .9em;
  text-align: center;
}

.uvq15-thm .q {
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq15-thm .ch {
  display: flex;
  justify-content: center;
  gap: .6em;
}

.uvq15-thm .ch button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: flex;
  align-items: center;
  gap: .45em;
  max-width: 8em;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  transition: max-width calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1),padding calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),transform .15s cubic-bezier(.25,.1,.25,1);
}

.uvq15-thm .ch button:hover {
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-thm .ch button:active {
  transform: scale(.95);
}

.uvq15-thm .ch button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-thm .ch svg {
  flex: none;
  width: 1.3em;
  height: 1.3em;
}

.uvq15-thm .y[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
  box-shadow: none;
}

.uvq15-thm .n[aria-pressed="true"] {
  color: #fff;
  background: var(--c2);
  box-shadow: none;
}

.uvq15-thm.yes .n,.uvq15-thm.no .y {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.uvq15-thm.yes .ch,.uvq15-thm.no .ch {
  gap: 0;
}

.uvq15-thm.yes .y svg {
  animation: uvq15-thm-u calc(0.6s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq15-thm.no .n svg {
  animation: uvq15-thm-d calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-thm-u {
  40% {
    transform: translateY(-.3em) rotate(-22deg) scale(1.25);
  }
}

@keyframes uvq15-thm-d {
  25% {
    transform: rotate(14deg) translateY(.15em);
  }
  50% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

.uvq15-thm .cf {
  position: absolute;
  left: 1.75em;
  top: 50%;
  pointer-events: none;
}

.uvq15-thm .cf i {
  position: absolute;
  width: .35em;
  height: .35em;
  margin: -.175em;
  border-radius: .1em;
  background: var(--c1);
  opacity: 0;
}

.uvq15-thm .cf i:nth-child(3n+1) {
  background: #facc15;
}

.uvq15-thm .cf i:nth-child(3n+2) {
  background: #38bdf8;
}

.uvq15-thm.yes .cf i {
  animation: uvq15-thm-c calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq15-thm-c {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(-.4em);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-2.6em) rotate(160deg);
  }
}

.uvq15-thm .mo {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  transition: grid-template-rows calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq15-thm.no:not(.sent) .mo {
  grid-template-rows: 1fr;
}

.uvq15-thm .fm {
  display: grid;
  gap: .5em;
  min-height: 0;
  overflow: hidden;
}

.uvq15-thm textarea {
  margin-top: .8em;
  padding: .6em .8em;
  border: 0;
  border-radius: .7em;
  resize: none;
  font: inherit;
  font-size: .85em;
  color: inherit;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  outline: 0;
}

.uvq15-thm textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c2);
}

.uvq15-thm .sd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  justify-self: end;
  margin: 0 .1em .2em;
  padding: .5em 1em;
  border-radius: .6em;
  font-size: .85em;
  font-weight: 700;
  color: #fff;
  background: var(--c2);
}

.uvq15-thm .sd:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-thm .ty {
  min-height: 1.3em;
  margin: .6em 0 0;
  font-size: .85em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-thm .ty:not(:empty) {
  animation: uvq15-thm-t calc(0.4s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq15-thm-t {
  from {
    opacity: 0;
    transform: translateY(.4em);
  }
}

.uvq15-thm .rs {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .2em;
  font-size: .72em;
  text-decoration: underline;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-thm .rs[hidden] {
  display: none;
}

.uvq15-thm .rs:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-thm,.uvq15-thm *,.uvq15-thm *::before,.uvq15-thm *::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 y=el.querySelector(".y"),n=el.querySelector(".n"),ty=el.querySelector(".ty"),mo=el.querySelector(".mo"),fm=el.querySelector(".fm"),ta=el.querySelector("textarea"),rs=el.querySelector(".rs");let tm=0;mo.inert=true;
const pick=v=>{if(el.classList.contains("yes")||el.classList.contains("no"))return;el.classList.add(v?"yes":"no");(v?y:n).setAttribute("aria-pressed","true");const o=v?n:y;o.tabIndex=-1;o.setAttribute("aria-hidden","true");
if(v){ty.textContent="Thanks for your feedback";rs.hidden=false}else{mo.inert=false;tm=setTimeout(()=>ta.focus(),350)}};
y.addEventListener("click",()=>pick(true));n.addEventListener("click",()=>pick(false));
fm.addEventListener("submit",e=>{e.preventDefault();el.classList.add("sent");mo.inert=true;ty.textContent="Thanks, we’ll look into it";rs.hidden=false;rs.focus()});
rs.addEventListener("click",()=>{el.classList.remove("yes","no","sent");[y,n].forEach(b=>{b.setAttribute("aria-pressed","false");b.tabIndex=0;b.removeAttribute("aria-hidden")});mo.inert=true;ty.textContent="";ta.value="";rs.hidden=true;y.focus()});return()=>clearTimeout(tm)
}

export default function Mi27HelpfulThumbs() {
  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": "#16a34a",
          "--c2": "#e11d48",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq15-thm"><p className="q">Was this article helpful?</p><div className="ch"><button type="button" className="y" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM7 10l4-7a2.5 2.5 0 0 1 3 2.5V9h5.5a2 2 0 0 1 2 2.3l-1.2 7.5a2.5 2.5 0 0 1-2.5 2.2H7" /></svg><span>Yes</span><span className="cf" aria-hidden="true"><i style={{ "--a": "0deg" } as CSSProperties}></i><i style={{ "--a": "51deg" } as CSSProperties}></i><i style={{ "--a": "102deg" } as CSSProperties}></i><i style={{ "--a": "153deg" } as CSSProperties}></i><i style={{ "--a": "204deg" } as CSSProperties}></i><i style={{ "--a": "255deg" } as CSSProperties}></i><i style={{ "--a": "306deg" } as CSSProperties}></i></span></button><button type="button" className="n" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1zM17 14l-4 7a2.5 2.5 0 0 1-3-2.5V15H4.5a2 2 0 0 1-2-2.3l1.2-7.5A2.5 2.5 0 0 1 6.2 3H17" /></svg><span>No</span></button></div><div className="mo"><form className="fm"><textarea rows={2} placeholder="What can we improve?" aria-label="What can we improve?"></textarea><button type="submit" className="sd">Send</button></form></div><p className="ty" aria-live="polite"></p><button type="button" className="rs" hidden={true}>Change answer</button></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 “Was this helpful thumbs” block (Microinteractions) from AIMRAN Library to my project.

## What it is
The chosen thumb hops while the other shrinks away; yes brings confetti, no unfolds a field to say what to improve.

## Chosen settings
- Main color: #16a34a
- Secondary color: #e11d48
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "¿Te ha sido útil este artículo?"

## 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 = `
.uvq15-thm {
  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;
  position: relative;
  border-radius: 1.3em;
  background: color-mix(in srgb,var(--fg) 3%,var(--bg));
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent),0 1.4em 2.6em -1.8em rgba(0,0,0,.35);
  display: grid;
  justify-items: center;
  width: 18em;
  padding: 1.1em 1.1em .9em;
  text-align: center;
}

.uvq15-thm .q {
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq15-thm .ch {
  display: flex;
  justify-content: center;
  gap: .6em;
}

.uvq15-thm .ch button {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: flex;
  align-items: center;
  gap: .45em;
  max-width: 8em;
  padding: .6em 1.1em;
  border-radius: 2em;
  font-weight: 700;
  white-space: nowrap;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  transition: max-width calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1),padding calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),background calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),color calc(0.25s / var(--k)) cubic-bezier(.25,.1,.25,1),transform .15s cubic-bezier(.25,.1,.25,1);
}

.uvq15-thm .ch button:hover {
  background: color-mix(in srgb,var(--fg) 10%,transparent);
}

.uvq15-thm .ch button:active {
  transform: scale(.95);
}

.uvq15-thm .ch button:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-thm .ch svg {
  flex: none;
  width: 1.3em;
  height: 1.3em;
}

.uvq15-thm .y[aria-pressed="true"] {
  color: #fff;
  background: var(--c1);
  box-shadow: none;
}

.uvq15-thm .n[aria-pressed="true"] {
  color: #fff;
  background: var(--c2);
  box-shadow: none;
}

.uvq15-thm.yes .n,.uvq15-thm.no .y {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.uvq15-thm.yes .ch,.uvq15-thm.no .ch {
  gap: 0;
}

.uvq15-thm.yes .y svg {
  animation: uvq15-thm-u calc(0.6s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq15-thm.no .n svg {
  animation: uvq15-thm-d calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

@keyframes uvq15-thm-u {
  40% {
    transform: translateY(-.3em) rotate(-22deg) scale(1.25);
  }
}

@keyframes uvq15-thm-d {
  25% {
    transform: rotate(14deg) translateY(.15em);
  }
  50% {
    transform: rotate(-8deg);
  }
  75% {
    transform: rotate(6deg);
  }
}

.uvq15-thm .cf {
  position: absolute;
  left: 1.75em;
  top: 50%;
  pointer-events: none;
}

.uvq15-thm .cf i {
  position: absolute;
  width: .35em;
  height: .35em;
  margin: -.175em;
  border-radius: .1em;
  background: var(--c1);
  opacity: 0;
}

.uvq15-thm .cf i:nth-child(3n+1) {
  background: #facc15;
}

.uvq15-thm .cf i:nth-child(3n+2) {
  background: #38bdf8;
}

.uvq15-thm.yes .cf i {
  animation: uvq15-thm-c calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq15-thm-c {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateY(-.4em);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateY(-2.6em) rotate(160deg);
  }
}

.uvq15-thm .mo {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  transition: grid-template-rows calc(0.45s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq15-thm.no:not(.sent) .mo {
  grid-template-rows: 1fr;
}

.uvq15-thm .fm {
  display: grid;
  gap: .5em;
  min-height: 0;
  overflow: hidden;
}

.uvq15-thm textarea {
  margin-top: .8em;
  padding: .6em .8em;
  border: 0;
  border-radius: .7em;
  resize: none;
  font: inherit;
  font-size: .85em;
  color: inherit;
  background: color-mix(in srgb,var(--fg) 6%,transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  outline: 0;
}

.uvq15-thm textarea:focus-visible {
  box-shadow: inset 0 0 0 2px var(--c2);
}

.uvq15-thm .sd {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  justify-self: end;
  margin: 0 .1em .2em;
  padding: .5em 1em;
  border-radius: .6em;
  font-size: .85em;
  font-weight: 700;
  color: #fff;
  background: var(--c2);
}

.uvq15-thm .sd:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq15-thm .ty {
  min-height: 1.3em;
  margin: .6em 0 0;
  font-size: .85em;
  font-weight: 600;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-thm .ty:not(:empty) {
  animation: uvq15-thm-t calc(0.4s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq15-thm-t {
  from {
    opacity: 0;
    transform: translateY(.4em);
  }
}

.uvq15-thm .rs {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  margin-top: .2em;
  font-size: .72em;
  text-decoration: underline;
  color: color-mix(in srgb,var(--fg) 55%,transparent);
}

.uvq15-thm .rs[hidden] {
  display: none;
}

.uvq15-thm .rs:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@media (prefers-reduced-motion:reduce) {
  .uvq15-thm,.uvq15-thm *,.uvq15-thm *::before,.uvq15-thm *::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 y=el.querySelector(".y"),n=el.querySelector(".n"),ty=el.querySelector(".ty"),mo=el.querySelector(".mo"),fm=el.querySelector(".fm"),ta=el.querySelector("textarea"),rs=el.querySelector(".rs");let tm=0;mo.inert=true;
const pick=v=>{if(el.classList.contains("yes")||el.classList.contains("no"))return;el.classList.add(v?"yes":"no");(v?y:n).setAttribute("aria-pressed","true");const o=v?n:y;o.tabIndex=-1;o.setAttribute("aria-hidden","true");
if(v){ty.textContent="Thanks for your feedback";rs.hidden=false}else{mo.inert=false;tm=setTimeout(()=>ta.focus(),350)}};
y.addEventListener("click",()=>pick(true));n.addEventListener("click",()=>pick(false));
fm.addEventListener("submit",e=>{e.preventDefault();el.classList.add("sent");mo.inert=true;ty.textContent="Thanks, we’ll look into it";rs.hidden=false;rs.focus()});
rs.addEventListener("click",()=>{el.classList.remove("yes","no","sent");[y,n].forEach(b=>{b.setAttribute("aria-pressed","false");b.tabIndex=0;b.removeAttribute("aria-hidden")});mo.inert=true;ty.textContent="";ta.value="";rs.hidden=true;y.focus()});return()=>clearTimeout(tm)
}

export default function Mi27HelpfulThumbs() {
  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": "#16a34a",
          "--c2": "#e11d48",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <div className="uvq15-thm"><p className="q">Was this article helpful?</p><div className="ch"><button type="button" className="y" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zM7 10l4-7a2.5 2.5 0 0 1 3 2.5V9h5.5a2 2 0 0 1 2 2.3l-1.2 7.5a2.5 2.5 0 0 1-2.5 2.2H7" /></svg><span>Yes</span><span className="cf" aria-hidden="true"><i style={{ "--a": "0deg" } as CSSProperties}></i><i style={{ "--a": "51deg" } as CSSProperties}></i><i style={{ "--a": "102deg" } as CSSProperties}></i><i style={{ "--a": "153deg" } as CSSProperties}></i><i style={{ "--a": "204deg" } as CSSProperties}></i><i style={{ "--a": "255deg" } as CSSProperties}></i><i style={{ "--a": "306deg" } as CSSProperties}></i></span></button><button type="button" className="n" aria-pressed="false"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M17 14V3h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1zM17 14l-4 7a2.5 2.5 0 0 1-3-2.5V15H4.5a2 2 0 0 1-2-2.3l1.2-7.5A2.5 2.5 0 0 1 6.2 3H17" /></svg><span>No</span></button></div><div className="mo"><form className="fm"><textarea rows={2} placeholder="What can we improve?" aria-label="What can we improve?"></textarea><button type="submit" className="sd">Send</button></form></div><p className="ty" aria-live="polite"></p><button type="button" className="rs" hidden={true}>Change answer</button></div>
      </div>
    </>
  );
}
```

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