# Pinch of salt checkbox

> A recipe step: the salt shaker tips over, shakes twice and the grains fall into the bowl before the tick appears.

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

## Where to use it

Made for recipe steps, this checkbox pairs a glass salt shaker with a metal cap and a small ceramic bowl. Checking it tips the shaker over the bowl, shakes it twice, lets nine grains fall one after another and then draws a tick inside the bowl while its rim takes the main color. Hovering tilts the shaker a little. It fits cooking apps, ingredient checklists and meal planners.

The main color is the tick and the bowl rim, the secondary color the ceramic. Swap the label for any ingredient step, such as a dash of pepper or a spoon of sugar, and stack several steps to follow a recipe.

## Code

### HTML

```html
<label class="uvq02-slt"><input type="checkbox"><span class="bx" aria-hidden="true"><span class="sk"><i></i></span><b style="--i:0;--x:-0.35em"></b><b style="--i:1;--x:0.11em"></b><b style="--i:2;--x:0.19em"></b><b style="--i:3;--x:-0.14em"></b><b style="--i:4;--x:0.11em"></b><b style="--i:5;--x:-0.28em"></b><b style="--i:6;--x:-0.19em"></b><b style="--i:7;--x:-0.07em"></b><b style="--i:8;--x:-0.07em"></b><span class="dh"></span><span class="ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1"/></svg></span></span>Add a pinch of salt</label>
```

### CSS

```css
.uvq02-slt {
  --c1: #2f8f6f;
  --c2: #e9e1d3;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq02-slt {
  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: .8em;
}

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

.uvq02-slt .bx {
  position: relative;
  flex: none;
  width: 3em;
  height: 3.6em;
}

.uvq02-slt .sk {
  position: absolute;
  left: 1em;
  top: .45em;
  width: 1em;
  height: 1.5em;
  border-radius: .25em .25em .35em .35em;
  background: linear-gradient(90deg,rgba(255,255,255,.75),rgba(255,255,255,.2) 45%,rgba(255,255,255,.55)),linear-gradient(to top,#fff 0 58%,color-mix(in srgb,var(--fg) 6%,transparent) 58%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 28%,transparent);
  transform-origin: 50% 40%;
  z-index: 2;
}

.uvq02-slt .sk i {
  position: absolute;
  left: -.06em;
  right: -.06em;
  top: -.42em;
  height: .5em;
  border-radius: .5em .5em .08em .08em;
  background: radial-gradient(circle,#555 .04em,transparent .06em) 0 0/.22em .22em,linear-gradient(90deg,#9ea2a8,#f1f2f4 45%,#8c9096);
}

.uvq02-slt b {
  position: absolute;
  left: calc(1.45em + var(--x));
  top: 2em;
  width: .13em;
  height: .13em;
  border-radius: 30%;
  background: #fff;
  box-shadow: 0 0 0 .5px color-mix(in srgb,var(--fg) 35%,transparent);
  opacity: 0;
  z-index: 1;
}

.uvq02-slt .dh {
  position: absolute;
  left: .25em;
  right: .25em;
  bottom: .15em;
  height: 1.15em;
  border-radius: .2em .2em 1.1em 1.1em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 70%,#000) 0 .12em,var(--c2) .12em);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 18%,transparent),0 .25em .4em -.2em rgba(0,0,0,.35);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt .ok {
  position: absolute;
  left: 50%;
  bottom: .22em;
  display: grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: -.55em;
  z-index: 3;
  color: var(--c1);
}

.uvq02-slt .ok svg {
  width: 1em;
  height: 1em;
}

.uvq02-slt .ok path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt:hover .sk {
  transform: rotate(12deg);
}

.uvq02-slt:active .sk {
  transform: rotate(25deg);
}

.uvq02-slt input:checked + .bx .sk {
  animation: uvq02-slt calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt input:checked + .bx b {
  animation: uvq02-slt-g calc(0.55s / var(--k)) cubic-bezier(.5,0,1,1) calc(calc(0.3s / var(--k)) + var(--i) * calc(0.06s / var(--k))) both;
}

.uvq02-slt input:checked + .bx .dh {
  box-shadow: inset 0 0 0 2px var(--c1),0 .25em .4em -.2em rgba(0,0,0,.35);
}

.uvq02-slt input:checked + .bx .ok path {
  stroke-dashoffset: 0;
  transition-delay: calc(1.05s / var(--k));
}

@keyframes uvq02-slt {
  0%,100% {
    transform: none;
  }
  20% {
    transform: translateX(.25em) rotate(150deg);
  }
  32% {
    transform: translateX(.25em) rotate(128deg);
  }
  44% {
    transform: translateX(.25em) rotate(150deg);
  }
  56% {
    transform: translateX(.25em) rotate(128deg);
  }
  75% {
    transform: translateX(.25em) rotate(145deg);
  }
}

@keyframes uvq02-slt-g {
  0% {
    opacity: 0;
    transform: none;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(.55em);
  }
}

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

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

### React

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

const css = `
.uvq02-slt {
  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: .8em;
}

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

.uvq02-slt .bx {
  position: relative;
  flex: none;
  width: 3em;
  height: 3.6em;
}

.uvq02-slt .sk {
  position: absolute;
  left: 1em;
  top: .45em;
  width: 1em;
  height: 1.5em;
  border-radius: .25em .25em .35em .35em;
  background: linear-gradient(90deg,rgba(255,255,255,.75),rgba(255,255,255,.2) 45%,rgba(255,255,255,.55)),linear-gradient(to top,#fff 0 58%,color-mix(in srgb,var(--fg) 6%,transparent) 58%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 28%,transparent);
  transform-origin: 50% 40%;
  z-index: 2;
}

.uvq02-slt .sk i {
  position: absolute;
  left: -.06em;
  right: -.06em;
  top: -.42em;
  height: .5em;
  border-radius: .5em .5em .08em .08em;
  background: radial-gradient(circle,#555 .04em,transparent .06em) 0 0/.22em .22em,linear-gradient(90deg,#9ea2a8,#f1f2f4 45%,#8c9096);
}

.uvq02-slt b {
  position: absolute;
  left: calc(1.45em + var(--x));
  top: 2em;
  width: .13em;
  height: .13em;
  border-radius: 30%;
  background: #fff;
  box-shadow: 0 0 0 .5px color-mix(in srgb,var(--fg) 35%,transparent);
  opacity: 0;
  z-index: 1;
}

.uvq02-slt .dh {
  position: absolute;
  left: .25em;
  right: .25em;
  bottom: .15em;
  height: 1.15em;
  border-radius: .2em .2em 1.1em 1.1em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 70%,#000) 0 .12em,var(--c2) .12em);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 18%,transparent),0 .25em .4em -.2em rgba(0,0,0,.35);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt .ok {
  position: absolute;
  left: 50%;
  bottom: .22em;
  display: grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: -.55em;
  z-index: 3;
  color: var(--c1);
}

.uvq02-slt .ok svg {
  width: 1em;
  height: 1em;
}

.uvq02-slt .ok path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt:hover .sk {
  transform: rotate(12deg);
}

.uvq02-slt:active .sk {
  transform: rotate(25deg);
}

.uvq02-slt input:checked + .bx .sk {
  animation: uvq02-slt calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt input:checked + .bx b {
  animation: uvq02-slt-g calc(0.55s / var(--k)) cubic-bezier(.5,0,1,1) calc(calc(0.3s / var(--k)) + var(--i) * calc(0.06s / var(--k))) both;
}

.uvq02-slt input:checked + .bx .dh {
  box-shadow: inset 0 0 0 2px var(--c1),0 .25em .4em -.2em rgba(0,0,0,.35);
}

.uvq02-slt input:checked + .bx .ok path {
  stroke-dashoffset: 0;
  transition-delay: calc(1.05s / var(--k));
}

@keyframes uvq02-slt {
  0%,100% {
    transform: none;
  }
  20% {
    transform: translateX(.25em) rotate(150deg);
  }
  32% {
    transform: translateX(.25em) rotate(128deg);
  }
  44% {
    transform: translateX(.25em) rotate(150deg);
  }
  56% {
    transform: translateX(.25em) rotate(128deg);
  }
  75% {
    transform: translateX(.25em) rotate(145deg);
  }
}

@keyframes uvq02-slt-g {
  0% {
    opacity: 0;
    transform: none;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(.55em);
  }
}

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

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

export default function ChkSaltPinch() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#2f8f6f",
          "--c2": "#e9e1d3",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-slt"><input type="checkbox" /><span className="bx" aria-hidden="true"><span className="sk"><i></i></span><b style={{ "--i": "0", "--x": "-0.35em" } as CSSProperties}></b><b style={{ "--i": "1", "--x": "0.11em" } as CSSProperties}></b><b style={{ "--i": "2", "--x": "0.19em" } as CSSProperties}></b><b style={{ "--i": "3", "--x": "-0.14em" } as CSSProperties}></b><b style={{ "--i": "4", "--x": "0.11em" } as CSSProperties}></b><b style={{ "--i": "5", "--x": "-0.28em" } as CSSProperties}></b><b style={{ "--i": "6", "--x": "-0.19em" } as CSSProperties}></b><b style={{ "--i": "7", "--x": "-0.07em" } as CSSProperties}></b><b style={{ "--i": "8", "--x": "-0.07em" } as CSSProperties}></b><span className="dh"></span><span className="ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" /></svg></span></span>Add a pinch of salt</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 “Pinch of salt checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
A recipe step: the salt shaker tips over, shakes twice and the grains fall into the bowl before the tick appears.

## Chosen settings
- Main color: #2f8f6f
- Secondary color: #e9e1d3
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Añadir una pizca de sal"

## 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-slt {
  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: .8em;
}

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

.uvq02-slt .bx {
  position: relative;
  flex: none;
  width: 3em;
  height: 3.6em;
}

.uvq02-slt .sk {
  position: absolute;
  left: 1em;
  top: .45em;
  width: 1em;
  height: 1.5em;
  border-radius: .25em .25em .35em .35em;
  background: linear-gradient(90deg,rgba(255,255,255,.75),rgba(255,255,255,.2) 45%,rgba(255,255,255,.55)),linear-gradient(to top,#fff 0 58%,color-mix(in srgb,var(--fg) 6%,transparent) 58%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 28%,transparent);
  transform-origin: 50% 40%;
  z-index: 2;
}

.uvq02-slt .sk i {
  position: absolute;
  left: -.06em;
  right: -.06em;
  top: -.42em;
  height: .5em;
  border-radius: .5em .5em .08em .08em;
  background: radial-gradient(circle,#555 .04em,transparent .06em) 0 0/.22em .22em,linear-gradient(90deg,#9ea2a8,#f1f2f4 45%,#8c9096);
}

.uvq02-slt b {
  position: absolute;
  left: calc(1.45em + var(--x));
  top: 2em;
  width: .13em;
  height: .13em;
  border-radius: 30%;
  background: #fff;
  box-shadow: 0 0 0 .5px color-mix(in srgb,var(--fg) 35%,transparent);
  opacity: 0;
  z-index: 1;
}

.uvq02-slt .dh {
  position: absolute;
  left: .25em;
  right: .25em;
  bottom: .15em;
  height: 1.15em;
  border-radius: .2em .2em 1.1em 1.1em;
  background: linear-gradient(180deg,color-mix(in srgb,var(--c2) 70%,#000) 0 .12em,var(--c2) .12em);
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 18%,transparent),0 .25em .4em -.2em rgba(0,0,0,.35);
  transition: box-shadow calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt .ok {
  position: absolute;
  left: 50%;
  bottom: .22em;
  display: grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: -.55em;
  z-index: 3;
  color: var(--c1);
}

.uvq02-slt .ok svg {
  width: 1em;
  height: 1em;
}

.uvq02-slt .ok path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt:hover .sk {
  transform: rotate(12deg);
}

.uvq02-slt:active .sk {
  transform: rotate(25deg);
}

.uvq02-slt input:checked + .bx .sk {
  animation: uvq02-slt calc(1.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-slt input:checked + .bx b {
  animation: uvq02-slt-g calc(0.55s / var(--k)) cubic-bezier(.5,0,1,1) calc(calc(0.3s / var(--k)) + var(--i) * calc(0.06s / var(--k))) both;
}

.uvq02-slt input:checked + .bx .dh {
  box-shadow: inset 0 0 0 2px var(--c1),0 .25em .4em -.2em rgba(0,0,0,.35);
}

.uvq02-slt input:checked + .bx .ok path {
  stroke-dashoffset: 0;
  transition-delay: calc(1.05s / var(--k));
}

@keyframes uvq02-slt {
  0%,100% {
    transform: none;
  }
  20% {
    transform: translateX(.25em) rotate(150deg);
  }
  32% {
    transform: translateX(.25em) rotate(128deg);
  }
  44% {
    transform: translateX(.25em) rotate(150deg);
  }
  56% {
    transform: translateX(.25em) rotate(128deg);
  }
  75% {
    transform: translateX(.25em) rotate(145deg);
  }
}

@keyframes uvq02-slt-g {
  0% {
    opacity: 0;
    transform: none;
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(.55em);
  }
}

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

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

export default function ChkSaltPinch() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#2f8f6f",
          "--c2": "#e9e1d3",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-slt"><input type="checkbox" /><span className="bx" aria-hidden="true"><span className="sk"><i></i></span><b style={{ "--i": "0", "--x": "-0.35em" } as CSSProperties}></b><b style={{ "--i": "1", "--x": "0.11em" } as CSSProperties}></b><b style={{ "--i": "2", "--x": "0.19em" } as CSSProperties}></b><b style={{ "--i": "3", "--x": "-0.14em" } as CSSProperties}></b><b style={{ "--i": "4", "--x": "0.11em" } as CSSProperties}></b><b style={{ "--i": "5", "--x": "-0.28em" } as CSSProperties}></b><b style={{ "--i": "6", "--x": "-0.19em" } as CSSProperties}></b><b style={{ "--i": "7", "--x": "-0.07em" } as CSSProperties}></b><b style={{ "--i": "8", "--x": "-0.07em" } as CSSProperties}></b><span className="dh"></span><span className="ok"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" pathLength="1" /></svg></span></span>Add a pinch of salt</label>
      </div>
    </>
  );
}
```

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