# Rolling pin checkbox

> On a floured wooden board, the rolling pin rolls across and flattens the ball of dough into a sheet.

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

## Where to use it

This checkbox is a floured wooden chopping board with a ball of dough in the middle and a rolling pin resting on one side. Checking it rolls the pin across the board, with its grain turning as it moves, flattens the dough into a wide uneven sheet and pops a small tick badge in the corner. It fits baking apps and pizza recipes.

The main color is the tick badge and the secondary color the dough, so you can go from pale pastry to wholemeal or a green spinach dough. Keep the label as a clear action, like a recipe step.

## Code

### HTML

```html
<label class="uvq02-rol"><input type="checkbox"><span class="bd" aria-hidden="true"><i class="dg"></i><span class="pn"></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>Roll out the dough</label>
```

### CSS

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

.uvq02-rol {
  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-rol input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-rol .bd {
  position: relative;
  flex: none;
  width: 5.6em;
  height: 3.2em;
  border-radius: .5em;
  background: radial-gradient(circle at 30% 40%,rgba(255,255,255,.55) .05em,transparent .07em) 0 0/.5em .45em,radial-gradient(60% 50% at 50% 55%,rgba(255,255,255,.35),transparent 70%),repeating-linear-gradient(176deg,rgba(120,70,20,.12) 0 .08em,transparent .08em .45em),#d9a66a;
  box-shadow: inset 0 0 0 .08em rgba(90,50,10,.25),0 .35em .6em -.3em rgba(0,0,0,.45);
}

.uvq02-rol .dg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5em;
  height: 1.2em;
  margin: -.6em 0 0 -.75em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%,#fff8e8,var(--c2) 62%,color-mix(in srgb,var(--c2) 82%,#8a5a24));
  box-shadow: 0 .12em .18em rgba(70,40,10,.3);
  transition: transform calc(0.7s / var(--k)) cubic-bezier(.5,0,.3,1),border-radius calc(0.7s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-rol .pn {
  position: absolute;
  left: .15em;
  top: -.45em;
  width: .85em;
  height: 4.1em;
  border-radius: .3em;
  background: repeating-linear-gradient(90deg,rgba(90,50,10,.18) 0 .06em,transparent .06em .3em) 0 0/100% 100%,linear-gradient(90deg,#b07a42,#ecbf86 40%,#c18b50);
  background-position: 0 0,0 0;
  box-shadow: .12em .2em .3em rgba(0,0,0,.3);
  transition: transform calc(1s / var(--k)) cubic-bezier(.45,0,.3,1),background-position calc(1s / var(--k)) cubic-bezier(.45,0,.3,1);
  z-index: 2;
}

.uvq02-rol .pn::before,.uvq02-rol .pn::after {
  content: "";
  position: absolute;
  left: .2em;
  right: .2em;
  height: .55em;
  background: linear-gradient(90deg,#6e4521,#a8723f 45%,#6e4521);
}

.uvq02-rol .pn::before {
  top: -.5em;
  border-radius: .25em .25em .05em .05em;
}

.uvq02-rol .pn::after {
  bottom: -.5em;
  border-radius: .05em .05em .25em .25em;
}

.uvq02-rol .ok {
  position: absolute;
  left: .3em;
  bottom: .3em;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--c1);
  color: #fff;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-rol .ok svg {
  width: .75em;
  height: .75em;
}

.uvq02-rol:hover .pn {
  transform: translateX(.35em);
}

.uvq02-rol:active .pn {
  transform: translateX(.6em);
}

.uvq02-rol input:checked + .bd .pn {
  transform: translateX(4.45em);
  background-position: 2.4em 0,0 0;
}

.uvq02-rol input:checked + .bd .dg {
  transform: scale(2.3,1.25);
  border-radius: 48% 52% 46% 54%/50% 46% 54% 50%;
  transition-delay: calc(0.3s / var(--k));
}

.uvq02-rol input:checked + .bd .ok {
  transform: none;
  transition-delay: calc(1s / var(--k));
}

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

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

### React

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

const css = `
.uvq02-rol {
  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-rol input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-rol .bd {
  position: relative;
  flex: none;
  width: 5.6em;
  height: 3.2em;
  border-radius: .5em;
  background: radial-gradient(circle at 30% 40%,rgba(255,255,255,.55) .05em,transparent .07em) 0 0/.5em .45em,radial-gradient(60% 50% at 50% 55%,rgba(255,255,255,.35),transparent 70%),repeating-linear-gradient(176deg,rgba(120,70,20,.12) 0 .08em,transparent .08em .45em),#d9a66a;
  box-shadow: inset 0 0 0 .08em rgba(90,50,10,.25),0 .35em .6em -.3em rgba(0,0,0,.45);
}

.uvq02-rol .dg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5em;
  height: 1.2em;
  margin: -.6em 0 0 -.75em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%,#fff8e8,var(--c2) 62%,color-mix(in srgb,var(--c2) 82%,#8a5a24));
  box-shadow: 0 .12em .18em rgba(70,40,10,.3);
  transition: transform calc(0.7s / var(--k)) cubic-bezier(.5,0,.3,1),border-radius calc(0.7s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-rol .pn {
  position: absolute;
  left: .15em;
  top: -.45em;
  width: .85em;
  height: 4.1em;
  border-radius: .3em;
  background: repeating-linear-gradient(90deg,rgba(90,50,10,.18) 0 .06em,transparent .06em .3em) 0 0/100% 100%,linear-gradient(90deg,#b07a42,#ecbf86 40%,#c18b50);
  background-position: 0 0,0 0;
  box-shadow: .12em .2em .3em rgba(0,0,0,.3);
  transition: transform calc(1s / var(--k)) cubic-bezier(.45,0,.3,1),background-position calc(1s / var(--k)) cubic-bezier(.45,0,.3,1);
  z-index: 2;
}

.uvq02-rol .pn::before,.uvq02-rol .pn::after {
  content: "";
  position: absolute;
  left: .2em;
  right: .2em;
  height: .55em;
  background: linear-gradient(90deg,#6e4521,#a8723f 45%,#6e4521);
}

.uvq02-rol .pn::before {
  top: -.5em;
  border-radius: .25em .25em .05em .05em;
}

.uvq02-rol .pn::after {
  bottom: -.5em;
  border-radius: .05em .05em .25em .25em;
}

.uvq02-rol .ok {
  position: absolute;
  left: .3em;
  bottom: .3em;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--c1);
  color: #fff;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-rol .ok svg {
  width: .75em;
  height: .75em;
}

.uvq02-rol:hover .pn {
  transform: translateX(.35em);
}

.uvq02-rol:active .pn {
  transform: translateX(.6em);
}

.uvq02-rol input:checked + .bd .pn {
  transform: translateX(4.45em);
  background-position: 2.4em 0,0 0;
}

.uvq02-rol input:checked + .bd .dg {
  transform: scale(2.3,1.25);
  border-radius: 48% 52% 46% 54%/50% 46% 54% 50%;
  transition-delay: calc(0.3s / var(--k));
}

.uvq02-rol input:checked + .bd .ok {
  transform: none;
  transition-delay: calc(1s / var(--k));
}

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

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

export default function ChkRollingPin() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#c2410c",
          "--c2": "#f3d9a4",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-rol"><input type="checkbox" /><span className="bd" aria-hidden="true"><i className="dg"></i><span className="pn"></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>Roll out the dough</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 “Rolling pin checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
On a floured wooden board, the rolling pin rolls across and flattens the ball of dough into a sheet.

## Chosen settings
- Main color: #c2410c
- Secondary color: #f3d9a4
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Estirar la masa"

## 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-rol {
  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-rol input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.uvq02-rol .bd {
  position: relative;
  flex: none;
  width: 5.6em;
  height: 3.2em;
  border-radius: .5em;
  background: radial-gradient(circle at 30% 40%,rgba(255,255,255,.55) .05em,transparent .07em) 0 0/.5em .45em,radial-gradient(60% 50% at 50% 55%,rgba(255,255,255,.35),transparent 70%),repeating-linear-gradient(176deg,rgba(120,70,20,.12) 0 .08em,transparent .08em .45em),#d9a66a;
  box-shadow: inset 0 0 0 .08em rgba(90,50,10,.25),0 .35em .6em -.3em rgba(0,0,0,.45);
}

.uvq02-rol .dg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.5em;
  height: 1.2em;
  margin: -.6em 0 0 -.75em;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%,#fff8e8,var(--c2) 62%,color-mix(in srgb,var(--c2) 82%,#8a5a24));
  box-shadow: 0 .12em .18em rgba(70,40,10,.3);
  transition: transform calc(0.7s / var(--k)) cubic-bezier(.5,0,.3,1),border-radius calc(0.7s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-rol .pn {
  position: absolute;
  left: .15em;
  top: -.45em;
  width: .85em;
  height: 4.1em;
  border-radius: .3em;
  background: repeating-linear-gradient(90deg,rgba(90,50,10,.18) 0 .06em,transparent .06em .3em) 0 0/100% 100%,linear-gradient(90deg,#b07a42,#ecbf86 40%,#c18b50);
  background-position: 0 0,0 0;
  box-shadow: .12em .2em .3em rgba(0,0,0,.3);
  transition: transform calc(1s / var(--k)) cubic-bezier(.45,0,.3,1),background-position calc(1s / var(--k)) cubic-bezier(.45,0,.3,1);
  z-index: 2;
}

.uvq02-rol .pn::before,.uvq02-rol .pn::after {
  content: "";
  position: absolute;
  left: .2em;
  right: .2em;
  height: .55em;
  background: linear-gradient(90deg,#6e4521,#a8723f 45%,#6e4521);
}

.uvq02-rol .pn::before {
  top: -.5em;
  border-radius: .25em .25em .05em .05em;
}

.uvq02-rol .pn::after {
  bottom: -.5em;
  border-radius: .05em .05em .25em .25em;
}

.uvq02-rol .ok {
  position: absolute;
  left: .3em;
  bottom: .3em;
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: var(--c1);
  color: #fff;
  transform: scale(0);
  transition: transform calc(0.35s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-rol .ok svg {
  width: .75em;
  height: .75em;
}

.uvq02-rol:hover .pn {
  transform: translateX(.35em);
}

.uvq02-rol:active .pn {
  transform: translateX(.6em);
}

.uvq02-rol input:checked + .bd .pn {
  transform: translateX(4.45em);
  background-position: 2.4em 0,0 0;
}

.uvq02-rol input:checked + .bd .dg {
  transform: scale(2.3,1.25);
  border-radius: 48% 52% 46% 54%/50% 46% 54% 50%;
  transition-delay: calc(0.3s / var(--k));
}

.uvq02-rol input:checked + .bd .ok {
  transform: none;
  transition-delay: calc(1s / var(--k));
}

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

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

export default function ChkRollingPin() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#c2410c",
          "--c2": "#f3d9a4",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-rol"><input type="checkbox" /><span className="bd" aria-hidden="true"><i className="dg"></i><span className="pn"></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>Roll out the dough</label>
      </div>
    </>
  );
}
```

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