# Retro toaster checkbox

> While unchecked the slot glows as it toasts; checking pops both slices up golden with a springy jump.

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

## Where to use it

This checkbox is a rounded retro toaster in a pastel colour, with a black slot, a side lever and little feet. While it is unchecked the slot glows orange as if the bread were toasting. Checking it raises the lever and pops both slices up with a springy jump, now golden with darker crusts, while two wisps of steam rise. It suits breakfast menus and recipe steps.

The main color is the toast and the secondary color the body of the toaster, so mint, butter yellow or chrome all work. The glow and steam loops stop under reduced motion, leaving a clear on and off state.

## Code

### HTML

```html
<label class="uvq02-tst"><input type="checkbox"><span class="ts" aria-hidden="true"><i class="br a"></i><i class="br b"></i><span class="bd"><i class="lv"></i></span><i class="sm"></i><i class="sm"></i></span>Toasted bread</label>
```

### CSS

```css
.uvq02-tst {
  --c1: #d98a2b;
  --c2: #9fd8cf;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq02-tst {
  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;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
  gap: .9em;
}

.uvq02-tst input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-tst .ts {
  position: relative;
  flex: none;
  width: 4.4em;
  height: 3.9em;
}

.uvq02-tst .bd {
  position: absolute;
  left: 0;
  right: .3em;
  bottom: .15em;
  height: 2.4em;
  border-radius: 1.1em 1.1em .55em .55em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 65%,#fff),var(--c2) 38%,color-mix(in srgb,var(--c2) 72%,#000));
  box-shadow: inset 0 .16em .1em rgba(255,255,255,.55),inset 0 -.2em .2em rgba(0,0,0,.12),0 .35em .5em -.25em rgba(0,0,0,.45);
  z-index: 2;
}

.uvq02-tst .bd::before {
  content: "";
  position: absolute;
  left: .55em;
  right: .55em;
  top: .2em;
  height: .26em;
  border-radius: .2em;
  background: #1b1b1b;
  box-shadow: 0 0 .35em .05em #ff7a2a;
  animation: uvq02-tst-h calc(1.4s / var(--k)) ease-in-out infinite alternate;
}

.uvq02-tst .bd::after {
  content: "";
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: -.18em;
  height: .22em;
  background: radial-gradient(circle at .25em 0,#333 .2em,transparent .21em) 0 0/100% 100% no-repeat,radial-gradient(circle at calc(100% - .25em) 0,#333 .2em,transparent .21em);
}

.uvq02-tst .lv {
  position: absolute;
  right: -.3em;
  top: .55em;
  width: .5em;
  height: .3em;
  border-radius: .12em;
  background: #2a2a2a;
  box-shadow: 0 .08em .1em rgba(0,0,0,.35);
  transform: translateY(1em);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-tst .br {
  position: absolute;
  left: .7em;
  top: 1.15em;
  width: 2.6em;
  height: 2em;
  border-radius: .95em .95em .2em .2em;
  background: #f3dca8;
  box-shadow: inset 0 0 0 .14em #c79352;
  z-index: 1;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.3,1.7,.5,1),background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-tst .b {
  left: 1.05em;
  top: 1.25em;
  filter: brightness(.93);
}

.uvq02-tst .sm {
  position: absolute;
  top: .2em;
  left: 1.5em;
  width: .16em;
  height: .8em;
  border-radius: 1em;
  background: linear-gradient(transparent,color-mix(in srgb,var(--fg) 28%,transparent));
  opacity: 0;
}

.uvq02-tst .sm + .sm {
  left: 2.4em;
}

.uvq02-tst:hover .lv {
  transform: translateY(.85em);
}

.uvq02-tst:active .lv {
  transform: translateY(1.1em);
}

.uvq02-tst input:checked + .ts .bd::before {
  animation: none;
  box-shadow: none;
}

.uvq02-tst input:checked + .ts .lv {
  transform: none;
}

.uvq02-tst input:checked + .ts .br {
  transform: translateY(-1.05em);
  background: radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--c1) 55%,#fff),var(--c1) 85%);
  box-shadow: inset 0 0 0 .14em color-mix(in srgb,var(--c1) 60%,#3a1c00);
}

.uvq02-tst input:checked + .ts .b {
  transform: translateY(-.8em) rotate(4deg);
  transition-delay: calc(0.06s / var(--k));
}

.uvq02-tst input:checked + .ts .sm {
  animation: uvq02-tst calc(1.6s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.5s / var(--k)) infinite;
}

.uvq02-tst input:checked + .ts .sm + .sm {
  animation-delay: calc(1.1s / var(--k));
}

@keyframes uvq02-tst-h {
  to {
    box-shadow: 0 0 .55em .12em #ff5a1a;
  }
}

@keyframes uvq02-tst {
  0% {
    opacity: 0;
    transform: translateY(0) scaleY(.6);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-1em) scaleY(1.1) skewX(10deg);
  }
}

.uvq02-tst input:focus-visible + .ts {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

### React

```tsx
import type { CSSProperties } from "react";

const css = `
.uvq02-tst {
  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;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
  gap: .9em;
}

.uvq02-tst input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-tst .ts {
  position: relative;
  flex: none;
  width: 4.4em;
  height: 3.9em;
}

.uvq02-tst .bd {
  position: absolute;
  left: 0;
  right: .3em;
  bottom: .15em;
  height: 2.4em;
  border-radius: 1.1em 1.1em .55em .55em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 65%,#fff),var(--c2) 38%,color-mix(in srgb,var(--c2) 72%,#000));
  box-shadow: inset 0 .16em .1em rgba(255,255,255,.55),inset 0 -.2em .2em rgba(0,0,0,.12),0 .35em .5em -.25em rgba(0,0,0,.45);
  z-index: 2;
}

.uvq02-tst .bd::before {
  content: "";
  position: absolute;
  left: .55em;
  right: .55em;
  top: .2em;
  height: .26em;
  border-radius: .2em;
  background: #1b1b1b;
  box-shadow: 0 0 .35em .05em #ff7a2a;
  animation: uvq02-tst-h calc(1.4s / var(--k)) ease-in-out infinite alternate;
}

.uvq02-tst .bd::after {
  content: "";
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: -.18em;
  height: .22em;
  background: radial-gradient(circle at .25em 0,#333 .2em,transparent .21em) 0 0/100% 100% no-repeat,radial-gradient(circle at calc(100% - .25em) 0,#333 .2em,transparent .21em);
}

.uvq02-tst .lv {
  position: absolute;
  right: -.3em;
  top: .55em;
  width: .5em;
  height: .3em;
  border-radius: .12em;
  background: #2a2a2a;
  box-shadow: 0 .08em .1em rgba(0,0,0,.35);
  transform: translateY(1em);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-tst .br {
  position: absolute;
  left: .7em;
  top: 1.15em;
  width: 2.6em;
  height: 2em;
  border-radius: .95em .95em .2em .2em;
  background: #f3dca8;
  box-shadow: inset 0 0 0 .14em #c79352;
  z-index: 1;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.3,1.7,.5,1),background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-tst .b {
  left: 1.05em;
  top: 1.25em;
  filter: brightness(.93);
}

.uvq02-tst .sm {
  position: absolute;
  top: .2em;
  left: 1.5em;
  width: .16em;
  height: .8em;
  border-radius: 1em;
  background: linear-gradient(transparent,color-mix(in srgb,var(--fg) 28%,transparent));
  opacity: 0;
}

.uvq02-tst .sm + .sm {
  left: 2.4em;
}

.uvq02-tst:hover .lv {
  transform: translateY(.85em);
}

.uvq02-tst:active .lv {
  transform: translateY(1.1em);
}

.uvq02-tst input:checked + .ts .bd::before {
  animation: none;
  box-shadow: none;
}

.uvq02-tst input:checked + .ts .lv {
  transform: none;
}

.uvq02-tst input:checked + .ts .br {
  transform: translateY(-1.05em);
  background: radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--c1) 55%,#fff),var(--c1) 85%);
  box-shadow: inset 0 0 0 .14em color-mix(in srgb,var(--c1) 60%,#3a1c00);
}

.uvq02-tst input:checked + .ts .b {
  transform: translateY(-.8em) rotate(4deg);
  transition-delay: calc(0.06s / var(--k));
}

.uvq02-tst input:checked + .ts .sm {
  animation: uvq02-tst calc(1.6s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.5s / var(--k)) infinite;
}

.uvq02-tst input:checked + .ts .sm + .sm {
  animation-delay: calc(1.1s / var(--k));
}

@keyframes uvq02-tst-h {
  to {
    box-shadow: 0 0 .55em .12em #ff5a1a;
  }
}

@keyframes uvq02-tst {
  0% {
    opacity: 0;
    transform: translateY(0) scaleY(.6);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-1em) scaleY(1.1) skewX(10deg);
  }
}

.uvq02-tst input:focus-visible + .ts {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

export default function ChkToaster() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#d98a2b",
          "--c2": "#9fd8cf",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-tst"><input type="checkbox" /><span className="ts" aria-hidden="true"><i className="br a"></i><i className="br b"></i><span className="bd"><i className="lv"></i></span><i className="sm"></i><i className="sm"></i></span>Toasted bread</label>
      </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 “Retro toaster checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
While unchecked the slot glows as it toasts; checking pops both slices up golden with a springy jump.

## Chosen settings
- Main color: #d98a2b
- Secondary color: #9fd8cf
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Pan tostado"

## 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
import type { CSSProperties } from "react";

const css = `
.uvq02-tst {
  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;
  display: inline-flex;
  align-items: center;
  gap: .75em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  font-weight: 550;
  gap: .9em;
}

.uvq02-tst input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-tst .ts {
  position: relative;
  flex: none;
  width: 4.4em;
  height: 3.9em;
}

.uvq02-tst .bd {
  position: absolute;
  left: 0;
  right: .3em;
  bottom: .15em;
  height: 2.4em;
  border-radius: 1.1em 1.1em .55em .55em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 65%,#fff),var(--c2) 38%,color-mix(in srgb,var(--c2) 72%,#000));
  box-shadow: inset 0 .16em .1em rgba(255,255,255,.55),inset 0 -.2em .2em rgba(0,0,0,.12),0 .35em .5em -.25em rgba(0,0,0,.45);
  z-index: 2;
}

.uvq02-tst .bd::before {
  content: "";
  position: absolute;
  left: .55em;
  right: .55em;
  top: .2em;
  height: .26em;
  border-radius: .2em;
  background: #1b1b1b;
  box-shadow: 0 0 .35em .05em #ff7a2a;
  animation: uvq02-tst-h calc(1.4s / var(--k)) ease-in-out infinite alternate;
}

.uvq02-tst .bd::after {
  content: "";
  position: absolute;
  left: .6em;
  right: .6em;
  bottom: -.18em;
  height: .22em;
  background: radial-gradient(circle at .25em 0,#333 .2em,transparent .21em) 0 0/100% 100% no-repeat,radial-gradient(circle at calc(100% - .25em) 0,#333 .2em,transparent .21em);
}

.uvq02-tst .lv {
  position: absolute;
  right: -.3em;
  top: .55em;
  width: .5em;
  height: .3em;
  border-radius: .12em;
  background: #2a2a2a;
  box-shadow: 0 .08em .1em rgba(0,0,0,.35);
  transform: translateY(1em);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-tst .br {
  position: absolute;
  left: .7em;
  top: 1.15em;
  width: 2.6em;
  height: 2em;
  border-radius: .95em .95em .2em .2em;
  background: #f3dca8;
  box-shadow: inset 0 0 0 .14em #c79352;
  z-index: 1;
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.3,1.7,.5,1),background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1),box-shadow calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-tst .b {
  left: 1.05em;
  top: 1.25em;
  filter: brightness(.93);
}

.uvq02-tst .sm {
  position: absolute;
  top: .2em;
  left: 1.5em;
  width: .16em;
  height: .8em;
  border-radius: 1em;
  background: linear-gradient(transparent,color-mix(in srgb,var(--fg) 28%,transparent));
  opacity: 0;
}

.uvq02-tst .sm + .sm {
  left: 2.4em;
}

.uvq02-tst:hover .lv {
  transform: translateY(.85em);
}

.uvq02-tst:active .lv {
  transform: translateY(1.1em);
}

.uvq02-tst input:checked + .ts .bd::before {
  animation: none;
  box-shadow: none;
}

.uvq02-tst input:checked + .ts .lv {
  transform: none;
}

.uvq02-tst input:checked + .ts .br {
  transform: translateY(-1.05em);
  background: radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--c1) 55%,#fff),var(--c1) 85%);
  box-shadow: inset 0 0 0 .14em color-mix(in srgb,var(--c1) 60%,#3a1c00);
}

.uvq02-tst input:checked + .ts .b {
  transform: translateY(-.8em) rotate(4deg);
  transition-delay: calc(0.06s / var(--k));
}

.uvq02-tst input:checked + .ts .sm {
  animation: uvq02-tst calc(1.6s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.5s / var(--k)) infinite;
}

.uvq02-tst input:checked + .ts .sm + .sm {
  animation-delay: calc(1.1s / var(--k));
}

@keyframes uvq02-tst-h {
  to {
    box-shadow: 0 0 .55em .12em #ff5a1a;
  }
}

@keyframes uvq02-tst {
  0% {
    opacity: 0;
    transform: translateY(0) scaleY(.6);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-1em) scaleY(1.1) skewX(10deg);
  }
}

.uvq02-tst input:focus-visible + .ts {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

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

export default function ChkToaster() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#d98a2b",
          "--c2": "#9fd8cf",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-tst"><input type="checkbox" /><span className="ts" aria-hidden="true"><i className="br a"></i><i className="br b"></i><span className="bd"><i className="lv"></i></span><i className="sm"></i><i className="sm"></i></span>Toasted bread</label>
      </div>
    </>
  );
}
```

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