# Protective film checkbox

> A clear protective film with a pull tab covers the box and peels off from the corner when checked.

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

## Where to use it

Peeling the plastic off a new device is one of those small pleasures, and this checkbox recreates it. A glossy film with a numbered pull tab covers a grey square; checking it peels the film away from the corner in 3D and reveals a bright surface with a tick. Hovering lifts the corner a little. It suits unboxing pages, product launches, onboarding and gadget shops.

The main and secondary colors build the gradient under the film, so pick your brand tones for the reveal. Unchecking puts the film back in place, which makes it a fun touch for a first-run setting rather than a long list.

## Code

### HTML

```html
<label class="uvq02-flm"><input type="checkbox"><span class="bx"><span class="sf"><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 class="fm" aria-hidden="true"><i>1</i></span></span>Peel off the protective film</label>
```

### CSS

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

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

.uvq02-flm .bx {
  position: relative;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  perspective: 9em;
}

.uvq02-flm .sf {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: .6em;
  background: color-mix(in srgb,var(--fg) 14%,transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  transition: 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-flm .sf svg {
  width: 1.3em;
  height: 1.3em;
}

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

.uvq02-flm .fm {
  position: absolute;
  inset: -.1em;
  border-radius: .66em;
  background: linear-gradient(125deg,rgba(255,255,255,.8),rgba(200,222,240,.55) 38%,rgba(255,255,255,.3) 55%,rgba(185,212,235,.6));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85),inset 0 0 0 .14em rgba(160,190,215,.35),0 .08em .2em rgba(0,0,0,.15);
  transform-origin: 0 0;
  transition: transform calc(0.65s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-flm .fm i {
  position: absolute;
  right: -.62em;
  bottom: .25em;
  width: .75em;
  height: .95em;
  border-radius: 0 .28em .28em 0;
  background: linear-gradient(90deg,rgba(215,232,245,.85),rgba(255,255,255,.9));
  box-shadow: inset 0 0 0 1px rgba(160,190,215,.6);
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .62em;
  font-style: normal;
  font-weight: 800;
  line-height: .95em;
  text-align: center;
  color: #4b6a85;
}

.uvq02-flm:hover input:not(:checked) + .bx .fm {
  transform: rotate3d(1,-1,0,22deg);
}

.uvq02-flm:active input:not(:checked) + .bx .fm {
  transform: rotate3d(1,-1,0,40deg);
}

.uvq02-flm input:checked + .bx .sf {
  background: linear-gradient(140deg,var(--c2),var(--c1) 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),0 .35em .8em -.3em var(--c1);
}

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

.uvq02-flm input:checked + .bx .fm {
  transform: translate(-.9em,-1.3em) rotate3d(1,-1,0,165deg) scale(.9);
  opacity: 0;
  transition: transform calc(0.65s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.35s / var(--k));
}

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

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

### React

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

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

.uvq02-flm .bx {
  position: relative;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  perspective: 9em;
}

.uvq02-flm .sf {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: .6em;
  background: color-mix(in srgb,var(--fg) 14%,transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  transition: 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-flm .sf svg {
  width: 1.3em;
  height: 1.3em;
}

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

.uvq02-flm .fm {
  position: absolute;
  inset: -.1em;
  border-radius: .66em;
  background: linear-gradient(125deg,rgba(255,255,255,.8),rgba(200,222,240,.55) 38%,rgba(255,255,255,.3) 55%,rgba(185,212,235,.6));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85),inset 0 0 0 .14em rgba(160,190,215,.35),0 .08em .2em rgba(0,0,0,.15);
  transform-origin: 0 0;
  transition: transform calc(0.65s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-flm .fm i {
  position: absolute;
  right: -.62em;
  bottom: .25em;
  width: .75em;
  height: .95em;
  border-radius: 0 .28em .28em 0;
  background: linear-gradient(90deg,rgba(215,232,245,.85),rgba(255,255,255,.9));
  box-shadow: inset 0 0 0 1px rgba(160,190,215,.6);
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .62em;
  font-style: normal;
  font-weight: 800;
  line-height: .95em;
  text-align: center;
  color: #4b6a85;
}

.uvq02-flm:hover input:not(:checked) + .bx .fm {
  transform: rotate3d(1,-1,0,22deg);
}

.uvq02-flm:active input:not(:checked) + .bx .fm {
  transform: rotate3d(1,-1,0,40deg);
}

.uvq02-flm input:checked + .bx .sf {
  background: linear-gradient(140deg,var(--c2),var(--c1) 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),0 .35em .8em -.3em var(--c1);
}

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

.uvq02-flm input:checked + .bx .fm {
  transform: translate(-.9em,-1.3em) rotate3d(1,-1,0,165deg) scale(.9);
  opacity: 0;
  transition: transform calc(0.65s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.35s / var(--k));
}

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

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

export default function ChkFilm() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#ff6a3d",
          "--c2": "#ffc04d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-flm"><input type="checkbox" /><span className="bx"><span className="sf"><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 className="fm" aria-hidden="true"><i>1</i></span></span>Peel off the protective film</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 “Protective film checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
A clear protective film with a pull tab covers the box and peels off from the corner when checked.

## Chosen settings
- Main color: #ff6a3d
- Secondary color: #ffc04d
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Quitar el plástico protector"

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

.uvq02-flm .bx {
  position: relative;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  perspective: 9em;
}

.uvq02-flm .sf {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: .6em;
  background: color-mix(in srgb,var(--fg) 14%,transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--fg) 10%,transparent);
  transition: 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-flm .sf svg {
  width: 1.3em;
  height: 1.3em;
}

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

.uvq02-flm .fm {
  position: absolute;
  inset: -.1em;
  border-radius: .66em;
  background: linear-gradient(125deg,rgba(255,255,255,.8),rgba(200,222,240,.55) 38%,rgba(255,255,255,.3) 55%,rgba(185,212,235,.6));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85),inset 0 0 0 .14em rgba(160,190,215,.35),0 .08em .2em rgba(0,0,0,.15);
  transform-origin: 0 0;
  transition: transform calc(0.65s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-flm .fm i {
  position: absolute;
  right: -.62em;
  bottom: .25em;
  width: .75em;
  height: .95em;
  border-radius: 0 .28em .28em 0;
  background: linear-gradient(90deg,rgba(215,232,245,.85),rgba(255,255,255,.9));
  box-shadow: inset 0 0 0 1px rgba(160,190,215,.6);
  font-family: ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  font-size: .62em;
  font-style: normal;
  font-weight: 800;
  line-height: .95em;
  text-align: center;
  color: #4b6a85;
}

.uvq02-flm:hover input:not(:checked) + .bx .fm {
  transform: rotate3d(1,-1,0,22deg);
}

.uvq02-flm:active input:not(:checked) + .bx .fm {
  transform: rotate3d(1,-1,0,40deg);
}

.uvq02-flm input:checked + .bx .sf {
  background: linear-gradient(140deg,var(--c2),var(--c1) 60%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55),0 .35em .8em -.3em var(--c1);
}

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

.uvq02-flm input:checked + .bx .fm {
  transform: translate(-.9em,-1.3em) rotate3d(1,-1,0,165deg) scale(.9);
  opacity: 0;
  transition: transform calc(0.65s / var(--k)) cubic-bezier(.22,1,.36,1),opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1) calc(0.35s / var(--k));
}

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

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

export default function ChkFilm() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#ff6a3d",
          "--c2": "#ffc04d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-flm"><input type="checkbox" /><span className="bx"><span className="sf"><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 className="fm" aria-hidden="true"><i>1</i></span></span>Peel off the protective film</label>
      </div>
    </>
  );
}
```

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