# Sprouting plant checkbox

> The seed in the clay pot grows a stem and two leaves with a spring, then sways gently.

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

## Where to use it

This checkbox is a small terracotta pot drawn in inline SVG. Checking it hides the seed, grows a stem with a drawn stroke and opens two leaves with a springy pop, then the little plant sways slowly in a loop. Hovering gives the pot a gentle wobble. It fits gardening apps, habit trackers, sustainability pages and onboarding steps that celebrate growth.

The main color tints the leaves and stem, the secondary color the pot, so you can do sage and clay, lime and charcoal or autumn tones. Reduced motion stops the sway and keeps the plant still.

## Code

### HTML

```html
<label class="uvq02-spr"><input type="checkbox"><span class="bx"><svg viewBox="0 0 32 32" aria-hidden="true"><g class="pl"><path class="sm" pathLength="1" d="M16 17.5c0-3-.7-5.6.3-8.8"/><path class="lf a" d="M16 12.2c-1.2-3-4.4-4-7-3.4.4 2.9 3.3 4.6 7 3.4z"/><path class="lf b" d="M16.3 9.4c1-3.2 4.2-4.6 7.2-4 .2 3-2.9 5-7.2 4z"/></g><ellipse class="so" cx="16" cy="17.6" rx="8.4" ry="1.5"/><ellipse class="sd" cx="16" cy="16.6" rx="1.4" ry=".95"/><path class="pt" d="M8.3 20h15.4l-1.9 9.3a1.6 1.6 0 0 1-1.6 1.3h-8.4a1.6 1.6 0 0 1-1.6-1.3z"/><rect class="rm" x="6.6" y="17.3" width="18.8" height="3.6" rx="1"/></svg></span>Plant basil</label>
```

### CSS

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

.uvq02-spr {
  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: .85em;
}

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

.uvq02-spr .bx {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.7em;
  height: 2.7em;
  border-radius: .8em;
  background: color-mix(in srgb,var(--c1) 9%,transparent);
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr svg {
  width: 2.2em;
  height: 2.2em;
  overflow: visible;
}

.uvq02-spr svg * {
  transform-box: view-box;
}

.uvq02-spr .pt {
  fill: var(--c2);
}

.uvq02-spr .rm {
  fill: color-mix(in srgb,var(--c2) 82%,#000);
}

.uvq02-spr .so {
  fill: #5a3b28;
}

.uvq02-spr .sd {
  fill: #a8774c;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr .pl {
  transform-origin: 16px 17.5px;
}

.uvq02-spr .sm {
  fill: none;
  stroke: var(--c1);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr .lf {
  fill: var(--c1);
  transform: scale(0);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-spr .a {
  transform-origin: 16px 12.2px;
}

.uvq02-spr .b {
  transform-origin: 16.3px 9.4px;
  fill: color-mix(in srgb,var(--c1) 80%,#fff);
}

.uvq02-spr:hover svg {
  animation: uvq02-spr-w calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr:active .bx {
  scale: .94;
}

.uvq02-spr input:checked + .bx {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq02-spr input:checked + .bx .sd {
  opacity: 0;
}

.uvq02-spr input:checked + .bx .sm {
  stroke-dashoffset: 0;
}

.uvq02-spr input:checked + .bx .lf {
  transform: none;
}

.uvq02-spr input:checked + .bx .a {
  transition-delay: calc(0.3s / var(--k));
}

.uvq02-spr input:checked + .bx .b {
  transition-delay: calc(0.42s / var(--k));
}

.uvq02-spr input:checked + .bx .pl {
  animation: uvq02-spr calc(3s / var(--k)) ease-in-out calc(0.9s / var(--k)) infinite;
}

@keyframes uvq02-spr {
  0%,100% {
    transform: rotate(0);
  }
  30% {
    transform: rotate(-5deg);
  }
  70% {
    transform: rotate(4deg);
  }
}

@keyframes uvq02-spr-w {
  30% {
    transform: rotate(-6deg);
  }
  70% {
    transform: rotate(4deg);
  }
}

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

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

### React

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

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

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

.uvq02-spr .bx {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.7em;
  height: 2.7em;
  border-radius: .8em;
  background: color-mix(in srgb,var(--c1) 9%,transparent);
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr svg {
  width: 2.2em;
  height: 2.2em;
  overflow: visible;
}

.uvq02-spr svg * {
  transform-box: view-box;
}

.uvq02-spr .pt {
  fill: var(--c2);
}

.uvq02-spr .rm {
  fill: color-mix(in srgb,var(--c2) 82%,#000);
}

.uvq02-spr .so {
  fill: #5a3b28;
}

.uvq02-spr .sd {
  fill: #a8774c;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr .pl {
  transform-origin: 16px 17.5px;
}

.uvq02-spr .sm {
  fill: none;
  stroke: var(--c1);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr .lf {
  fill: var(--c1);
  transform: scale(0);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-spr .a {
  transform-origin: 16px 12.2px;
}

.uvq02-spr .b {
  transform-origin: 16.3px 9.4px;
  fill: color-mix(in srgb,var(--c1) 80%,#fff);
}

.uvq02-spr:hover svg {
  animation: uvq02-spr-w calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr:active .bx {
  scale: .94;
}

.uvq02-spr input:checked + .bx {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq02-spr input:checked + .bx .sd {
  opacity: 0;
}

.uvq02-spr input:checked + .bx .sm {
  stroke-dashoffset: 0;
}

.uvq02-spr input:checked + .bx .lf {
  transform: none;
}

.uvq02-spr input:checked + .bx .a {
  transition-delay: calc(0.3s / var(--k));
}

.uvq02-spr input:checked + .bx .b {
  transition-delay: calc(0.42s / var(--k));
}

.uvq02-spr input:checked + .bx .pl {
  animation: uvq02-spr calc(3s / var(--k)) ease-in-out calc(0.9s / var(--k)) infinite;
}

@keyframes uvq02-spr {
  0%,100% {
    transform: rotate(0);
  }
  30% {
    transform: rotate(-5deg);
  }
  70% {
    transform: rotate(4deg);
  }
}

@keyframes uvq02-spr-w {
  30% {
    transform: rotate(-6deg);
  }
  70% {
    transform: rotate(4deg);
  }
}

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

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

export default function ChkSprout() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#3c9a4a",
          "--c2": "#d27445",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-spr"><input type="checkbox" /><span className="bx"><svg viewBox="0 0 32 32" aria-hidden="true"><g className="pl"><path className="sm" pathLength="1" d="M16 17.5c0-3-.7-5.6.3-8.8" /><path className="lf a" d="M16 12.2c-1.2-3-4.4-4-7-3.4.4 2.9 3.3 4.6 7 3.4z" /><path className="lf b" d="M16.3 9.4c1-3.2 4.2-4.6 7.2-4 .2 3-2.9 5-7.2 4z" /></g><ellipse className="so" cx="16" cy="17.6" rx="8.4" ry="1.5" /><ellipse className="sd" cx="16" cy="16.6" rx="1.4" ry=".95" /><path className="pt" d="M8.3 20h15.4l-1.9 9.3a1.6 1.6 0 0 1-1.6 1.3h-8.4a1.6 1.6 0 0 1-1.6-1.3z" /><rect className="rm" x="6.6" y="17.3" width="18.8" height="3.6" rx="1" /></svg></span>Plant basil</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 “Sprouting plant checkbox” block (Checkboxes) from AIMRAN Library to my project.

## What it is
The seed in the clay pot grows a stem and two leaves with a spring, then sways gently.

## Chosen settings
- Main color: #3c9a4a
- Secondary color: #d27445
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Plantar albahaca"

## 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-spr {
  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: .85em;
}

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

.uvq02-spr .bx {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.7em;
  height: 2.7em;
  border-radius: .8em;
  background: color-mix(in srgb,var(--c1) 9%,transparent);
  transition: background calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr svg {
  width: 2.2em;
  height: 2.2em;
  overflow: visible;
}

.uvq02-spr svg * {
  transform-box: view-box;
}

.uvq02-spr .pt {
  fill: var(--c2);
}

.uvq02-spr .rm {
  fill: color-mix(in srgb,var(--c2) 82%,#000);
}

.uvq02-spr .so {
  fill: #5a3b28;
}

.uvq02-spr .sd {
  fill: #a8774c;
  transition: opacity calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr .pl {
  transform-origin: 16px 17.5px;
}

.uvq02-spr .sm {
  fill: none;
  stroke: var(--c1);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr .lf {
  fill: var(--c1);
  transform: scale(0);
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1);
}

.uvq02-spr .a {
  transform-origin: 16px 12.2px;
}

.uvq02-spr .b {
  transform-origin: 16.3px 9.4px;
  fill: color-mix(in srgb,var(--c1) 80%,#fff);
}

.uvq02-spr:hover svg {
  animation: uvq02-spr-w calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq02-spr:active .bx {
  scale: .94;
}

.uvq02-spr input:checked + .bx {
  background: color-mix(in srgb,var(--c1) 16%,transparent);
}

.uvq02-spr input:checked + .bx .sd {
  opacity: 0;
}

.uvq02-spr input:checked + .bx .sm {
  stroke-dashoffset: 0;
}

.uvq02-spr input:checked + .bx .lf {
  transform: none;
}

.uvq02-spr input:checked + .bx .a {
  transition-delay: calc(0.3s / var(--k));
}

.uvq02-spr input:checked + .bx .b {
  transition-delay: calc(0.42s / var(--k));
}

.uvq02-spr input:checked + .bx .pl {
  animation: uvq02-spr calc(3s / var(--k)) ease-in-out calc(0.9s / var(--k)) infinite;
}

@keyframes uvq02-spr {
  0%,100% {
    transform: rotate(0);
  }
  30% {
    transform: rotate(-5deg);
  }
  70% {
    transform: rotate(4deg);
  }
}

@keyframes uvq02-spr-w {
  30% {
    transform: rotate(-6deg);
  }
  70% {
    transform: rotate(4deg);
  }
}

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

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

export default function ChkSprout() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#3c9a4a",
          "--c2": "#d27445",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <label className="uvq02-spr"><input type="checkbox" /><span className="bx"><svg viewBox="0 0 32 32" aria-hidden="true"><g className="pl"><path className="sm" pathLength="1" d="M16 17.5c0-3-.7-5.6.3-8.8" /><path className="lf a" d="M16 12.2c-1.2-3-4.4-4-7-3.4.4 2.9 3.3 4.6 7 3.4z" /><path className="lf b" d="M16.3 9.4c1-3.2 4.2-4.6 7.2-4 .2 3-2.9 5-7.2 4z" /></g><ellipse className="so" cx="16" cy="17.6" rx="8.4" ry="1.5" /><ellipse className="sd" cx="16" cy="16.6" rx="1.4" ry=".95" /><path className="pt" d="M8.3 20h15.4l-1.9 9.3a1.6 1.6 0 0 1-1.6 1.3h-8.4a1.6 1.6 0 0 1-1.6-1.3z" /><rect className="rm" x="6.6" y="17.3" width="18.8" height="3.6" rx="1" /></svg></span>Plant basil</label>
      </div>
    </>
  );
}
```

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