# Matchstick button

> A matchbox button: pressing strikes a spark and lights the match, pressing again blows it out with a wisp of smoke.

- Category: [Buttons](https://library.aimran.es/components/buttons)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-btn-match
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This toggle is drawn as the side of a matchbox, with a printed frame, a rough striker strip and a single match on the left. On hover the head glows, on click sparks fly and a CSS flame flickers above it while the box warms up. The head chars as it burns, and switching off sends up a curl of smoke. Great for candle shops or dark mode.

The main color is the flame and the secondary color is the match head, so a blue gas flame or a green head are easy variations. The state lives in aria-pressed, and with reduced motion the flame stays steady instead of flickering.

## Code

### HTML

```html
<button class="uvq01-mch" type="button" aria-pressed="false"><span class="m" aria-hidden="true"><span class="fl"><i></i><i></i></span><span class="sm"></span></span><span class="t">Turn on</span><span class="st" aria-hidden="true"></span></button>
```

### CSS

```css
.uvq01-mch {
  --c1: #ff8a1f;
  --c2: #d62839;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq01-mch {
  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;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  margin-top: 2.4em;
  padding: 1.1em 2.4em 1.1em 2.6em;
  border-radius: .6em;
  color: #3a2412;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #f3e6c9;
  box-shadow: inset 0 0 0 .25em #f3e6c9,inset 0 0 0 .32em #3a2412,0 12px 22px -14px rgba(60,30,10,.6);
  transition: background calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq01-mch .st {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: .8em;
  border-radius: 0 .6em .6em 0;
  background: radial-gradient(circle at 30% 30%,rgba(255,255,255,.2) 0 .5px,transparent 1px) 0 0/3px 3px,radial-gradient(circle at 70% 60%,rgba(0,0,0,.4) 0 .6px,transparent 1.1px) 0 0/4px 4px,#6b3b22;
}

.uvq01-mch .m {
  position: absolute;
  left: 1.05em;
  bottom: .75em;
  width: .3em;
  height: 2.9em;
  border-radius: .08em;
  background: linear-gradient(90deg,#d6ab72,#f2d6a8 50%,#c79659);
}

.uvq01-mch .m::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -.42em;
  width: .56em;
  height: .78em;
  translate: -50% 0;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--c2) 55%,#fff),var(--c2) 45%,color-mix(in srgb,var(--c2) 60%,#000));
  transition: background calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.8s / var(--k)),box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-mch .m::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -.15em;
  width: .16em;
  height: .16em;
  margin-left: -.08em;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.uvq01-mch .fl {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .1em);
  width: 1em;
  height: 1.9em;
  margin-left: -.5em;
  transform-origin: 50% 100%;
  scale: 0;
  transition: scale calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq01-mch .fl::after {
  content: "";
  position: absolute;
  inset: -70% -120%;
  border-radius: 50%;
  background: radial-gradient(closest-side,color-mix(in srgb,var(--c1) 40%,transparent),transparent);
  pointer-events: none;
}

.uvq01-mch .fl i {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50%/62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 78%,#fff3c4 0,var(--c1) 45%,color-mix(in srgb,var(--c1) 80%,#d62839) 75%,transparent 100%);
}

.uvq01-mch .fl i:nth-child(2) {
  inset: 38% 26% 2%;
  background: radial-gradient(circle at 50% 80%,#fff,#fff2b0 45%,transparent 75%);
}

.uvq01-mch .sm {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .2em);
  width: .6em;
  height: 1.6em;
  margin-left: -.3em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(130,130,130,.6),transparent);
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
}

.uvq01-mch:hover .m::before {
  box-shadow: 0 0 .5em color-mix(in srgb,var(--c1) 70%,transparent);
}

.uvq01-mch[aria-pressed="true"] {
  background: #f8dfae;
  box-shadow: inset 0 0 0 .25em #f8dfae,inset 0 0 0 .32em #3a2412,0 -1em 2.2em -1em color-mix(in srgb,var(--c1) 70%,transparent),0 12px 22px -14px rgba(60,30,10,.6);
}

.uvq01-mch[aria-pressed="true"] .m::before {
  background: radial-gradient(circle at 40% 35%,#5a4636,#1b1410 60%);
}

.uvq01-mch[aria-pressed="true"] .fl {
  scale: 1;
  animation: uvq01-mch-fk calc(0.16s / var(--k)) ease-in-out infinite alternate;
}

.uvq01-mch.is-strike .m::after {
  animation: uvq01-mch-sp calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-mch.is-out .sm {
  animation: uvq01-mch-sm calc(1.4s / var(--k)) ease-out;
}

.uvq01-mch:active {
  transform: scale(.97);
}

.uvq01-mch:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq01-mch-fk {
  0% {
    transform: skewX(-3deg) scaleY(1);
  }
  100% {
    transform: skewX(3deg) scaleY(1.08);
  }
}

@keyframes uvq01-mch-sp {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 #ffd27a,0 0 0 #ffd27a,0 0 0 #ffb347,0 0 0 #ffd27a,0 0 0 #fff;
  }
  100% {
    opacity: 0;
    box-shadow: -.7em -.6em 0 #ffd27a,.8em -.5em 0 #ffd27a,-.4em -1.1em 0 #ffb347,.5em -1.2em 0 #ffd27a,.1em -1.4em 0 #fff;
  }
}

@keyframes uvq01-mch-sm {
  0% {
    opacity: .85;
    transform: translateY(0) scale(.6);
  }
  100% {
    opacity: 0;
    transform: translateY(-1.8em) scale(1.7) skewX(12deg);
  }
}

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

### JavaScript

```js
document.querySelectorAll(".uvq01-mch").forEach(el => {
  let tm=0;
el.addEventListener("click",()=>{const on=el.getAttribute("aria-pressed")!=="true";el.setAttribute("aria-pressed",String(on));el.classList.remove("is-strike","is-out");void el.offsetWidth;el.classList.add(on?"is-strike":"is-out");clearTimeout(tm);tm=setTimeout(()=>el.classList.remove("is-strike","is-out"),1500)});
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 = `
.uvq01-mch {
  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;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  margin-top: 2.4em;
  padding: 1.1em 2.4em 1.1em 2.6em;
  border-radius: .6em;
  color: #3a2412;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #f3e6c9;
  box-shadow: inset 0 0 0 .25em #f3e6c9,inset 0 0 0 .32em #3a2412,0 12px 22px -14px rgba(60,30,10,.6);
  transition: background calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq01-mch .st {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: .8em;
  border-radius: 0 .6em .6em 0;
  background: radial-gradient(circle at 30% 30%,rgba(255,255,255,.2) 0 .5px,transparent 1px) 0 0/3px 3px,radial-gradient(circle at 70% 60%,rgba(0,0,0,.4) 0 .6px,transparent 1.1px) 0 0/4px 4px,#6b3b22;
}

.uvq01-mch .m {
  position: absolute;
  left: 1.05em;
  bottom: .75em;
  width: .3em;
  height: 2.9em;
  border-radius: .08em;
  background: linear-gradient(90deg,#d6ab72,#f2d6a8 50%,#c79659);
}

.uvq01-mch .m::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -.42em;
  width: .56em;
  height: .78em;
  translate: -50% 0;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--c2) 55%,#fff),var(--c2) 45%,color-mix(in srgb,var(--c2) 60%,#000));
  transition: background calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.8s / var(--k)),box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-mch .m::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -.15em;
  width: .16em;
  height: .16em;
  margin-left: -.08em;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.uvq01-mch .fl {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .1em);
  width: 1em;
  height: 1.9em;
  margin-left: -.5em;
  transform-origin: 50% 100%;
  scale: 0;
  transition: scale calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq01-mch .fl::after {
  content: "";
  position: absolute;
  inset: -70% -120%;
  border-radius: 50%;
  background: radial-gradient(closest-side,color-mix(in srgb,var(--c1) 40%,transparent),transparent);
  pointer-events: none;
}

.uvq01-mch .fl i {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50%/62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 78%,#fff3c4 0,var(--c1) 45%,color-mix(in srgb,var(--c1) 80%,#d62839) 75%,transparent 100%);
}

.uvq01-mch .fl i:nth-child(2) {
  inset: 38% 26% 2%;
  background: radial-gradient(circle at 50% 80%,#fff,#fff2b0 45%,transparent 75%);
}

.uvq01-mch .sm {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .2em);
  width: .6em;
  height: 1.6em;
  margin-left: -.3em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(130,130,130,.6),transparent);
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
}

.uvq01-mch:hover .m::before {
  box-shadow: 0 0 .5em color-mix(in srgb,var(--c1) 70%,transparent);
}

.uvq01-mch[aria-pressed="true"] {
  background: #f8dfae;
  box-shadow: inset 0 0 0 .25em #f8dfae,inset 0 0 0 .32em #3a2412,0 -1em 2.2em -1em color-mix(in srgb,var(--c1) 70%,transparent),0 12px 22px -14px rgba(60,30,10,.6);
}

.uvq01-mch[aria-pressed="true"] .m::before {
  background: radial-gradient(circle at 40% 35%,#5a4636,#1b1410 60%);
}

.uvq01-mch[aria-pressed="true"] .fl {
  scale: 1;
  animation: uvq01-mch-fk calc(0.16s / var(--k)) ease-in-out infinite alternate;
}

.uvq01-mch.is-strike .m::after {
  animation: uvq01-mch-sp calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-mch.is-out .sm {
  animation: uvq01-mch-sm calc(1.4s / var(--k)) ease-out;
}

.uvq01-mch:active {
  transform: scale(.97);
}

.uvq01-mch:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq01-mch-fk {
  0% {
    transform: skewX(-3deg) scaleY(1);
  }
  100% {
    transform: skewX(3deg) scaleY(1.08);
  }
}

@keyframes uvq01-mch-sp {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 #ffd27a,0 0 0 #ffd27a,0 0 0 #ffb347,0 0 0 #ffd27a,0 0 0 #fff;
  }
  100% {
    opacity: 0;
    box-shadow: -.7em -.6em 0 #ffd27a,.8em -.5em 0 #ffd27a,-.4em -1.1em 0 #ffb347,.5em -1.2em 0 #ffd27a,.1em -1.4em 0 #fff;
  }
}

@keyframes uvq01-mch-sm {
  0% {
    opacity: .85;
    transform: translateY(0) scale(.6);
  }
  100% {
    opacity: 0;
    transform: translateY(-1.8em) scale(1.7) skewX(12deg);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-mch,.uvq01-mch *,.uvq01-mch *::before,.uvq01-mch *::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) {
  let tm=0;
el.addEventListener("click",()=>{const on=el.getAttribute("aria-pressed")!=="true";el.setAttribute("aria-pressed",String(on));el.classList.remove("is-strike","is-out");void el.offsetWidth;el.classList.add(on?"is-strike":"is-out");clearTimeout(tm);tm=setTimeout(()=>el.classList.remove("is-strike","is-out"),1500)});
return()=>clearTimeout(tm)
}

export default function BtnMatch() {
  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": "#ff8a1f",
          "--c2": "#d62839",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <button className="uvq01-mch" type="button" aria-pressed="false"><span className="m" aria-hidden="true"><span className="fl"><i></i><i></i></span><span className="sm"></span></span><span className="t">Turn on</span><span className="st" aria-hidden="true"></span></button>
      </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 “Matchstick button” block (Buttons) from AIMRAN Library to my project.

## What it is
A matchbox button: pressing strikes a spark and lights the match, pressing again blows it out with a wisp of smoke.

## Chosen settings
- Main color: #ff8a1f
- Secondary color: #d62839
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Encender"

## 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 = `
.uvq01-mch {
  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;
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.005em;
  white-space: nowrap;
  user-select: none;
  margin-top: 2.4em;
  padding: 1.1em 2.4em 1.1em 2.6em;
  border-radius: .6em;
  color: #3a2412;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #f3e6c9;
  box-shadow: inset 0 0 0 .25em #f3e6c9,inset 0 0 0 .32em #3a2412,0 12px 22px -14px rgba(60,30,10,.6);
  transition: background calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1),transform calc(0.2s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq01-mch .st {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: .8em;
  border-radius: 0 .6em .6em 0;
  background: radial-gradient(circle at 30% 30%,rgba(255,255,255,.2) 0 .5px,transparent 1px) 0 0/3px 3px,radial-gradient(circle at 70% 60%,rgba(0,0,0,.4) 0 .6px,transparent 1.1px) 0 0/4px 4px,#6b3b22;
}

.uvq01-mch .m {
  position: absolute;
  left: 1.05em;
  bottom: .75em;
  width: .3em;
  height: 2.9em;
  border-radius: .08em;
  background: linear-gradient(90deg,#d6ab72,#f2d6a8 50%,#c79659);
}

.uvq01-mch .m::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -.42em;
  width: .56em;
  height: .78em;
  translate: -50% 0;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--c2) 55%,#fff),var(--c2) 45%,color-mix(in srgb,var(--c2) 60%,#000));
  transition: background calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.8s / var(--k)),box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-mch .m::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -.15em;
  width: .16em;
  height: .16em;
  margin-left: -.08em;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.uvq01-mch .fl {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .1em);
  width: 1em;
  height: 1.9em;
  margin-left: -.5em;
  transform-origin: 50% 100%;
  scale: 0;
  transition: scale calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq01-mch .fl::after {
  content: "";
  position: absolute;
  inset: -70% -120%;
  border-radius: 50%;
  background: radial-gradient(closest-side,color-mix(in srgb,var(--c1) 40%,transparent),transparent);
  pointer-events: none;
}

.uvq01-mch .fl i {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 50% 50%/62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 78%,#fff3c4 0,var(--c1) 45%,color-mix(in srgb,var(--c1) 80%,#d62839) 75%,transparent 100%);
}

.uvq01-mch .fl i:nth-child(2) {
  inset: 38% 26% 2%;
  background: radial-gradient(circle at 50% 80%,#fff,#fff2b0 45%,transparent 75%);
}

.uvq01-mch .sm {
  position: absolute;
  left: 50%;
  bottom: calc(100% + .2em);
  width: .6em;
  height: 1.6em;
  margin-left: -.3em;
  border-radius: 50%;
  background: radial-gradient(closest-side,rgba(130,130,130,.6),transparent);
  filter: blur(2px);
  opacity: 0;
  pointer-events: none;
}

.uvq01-mch:hover .m::before {
  box-shadow: 0 0 .5em color-mix(in srgb,var(--c1) 70%,transparent);
}

.uvq01-mch[aria-pressed="true"] {
  background: #f8dfae;
  box-shadow: inset 0 0 0 .25em #f8dfae,inset 0 0 0 .32em #3a2412,0 -1em 2.2em -1em color-mix(in srgb,var(--c1) 70%,transparent),0 12px 22px -14px rgba(60,30,10,.6);
}

.uvq01-mch[aria-pressed="true"] .m::before {
  background: radial-gradient(circle at 40% 35%,#5a4636,#1b1410 60%);
}

.uvq01-mch[aria-pressed="true"] .fl {
  scale: 1;
  animation: uvq01-mch-fk calc(0.16s / var(--k)) ease-in-out infinite alternate;
}

.uvq01-mch.is-strike .m::after {
  animation: uvq01-mch-sp calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq01-mch.is-out .sm {
  animation: uvq01-mch-sm calc(1.4s / var(--k)) ease-out;
}

.uvq01-mch:active {
  transform: scale(.97);
}

.uvq01-mch:focus-visible {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

@keyframes uvq01-mch-fk {
  0% {
    transform: skewX(-3deg) scaleY(1);
  }
  100% {
    transform: skewX(3deg) scaleY(1.08);
  }
}

@keyframes uvq01-mch-sp {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 #ffd27a,0 0 0 #ffd27a,0 0 0 #ffb347,0 0 0 #ffd27a,0 0 0 #fff;
  }
  100% {
    opacity: 0;
    box-shadow: -.7em -.6em 0 #ffd27a,.8em -.5em 0 #ffd27a,-.4em -1.1em 0 #ffb347,.5em -1.2em 0 #ffd27a,.1em -1.4em 0 #fff;
  }
}

@keyframes uvq01-mch-sm {
  0% {
    opacity: .85;
    transform: translateY(0) scale(.6);
  }
  100% {
    opacity: 0;
    transform: translateY(-1.8em) scale(1.7) skewX(12deg);
  }
}

@media (prefers-reduced-motion:reduce) {
  .uvq01-mch,.uvq01-mch *,.uvq01-mch *::before,.uvq01-mch *::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) {
  let tm=0;
el.addEventListener("click",()=>{const on=el.getAttribute("aria-pressed")!=="true";el.setAttribute("aria-pressed",String(on));el.classList.remove("is-strike","is-out");void el.offsetWidth;el.classList.add(on?"is-strike":"is-out");clearTimeout(tm);tm=setTimeout(()=>el.classList.remove("is-strike","is-out"),1500)});
return()=>clearTimeout(tm)
}

export default function BtnMatch() {
  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": "#ff8a1f",
          "--c2": "#d62839",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <button className="uvq01-mch" type="button" aria-pressed="false"><span className="m" aria-hidden="true"><span className="fl"><i></i><i></i></span><span className="sm"></span></span><span className="t">Turn on</span><span className="st" aria-hidden="true"></span></button>
      </div>
    </>
  );
}
```

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