# Herbarium leaf shape filter

> Herbarium sheets with pressed leaves: tick a shape and the leaf turns green again while its name gets circled in pencil.

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

## Where to use it

Plant shops, garden centres and nature guides can filter by leaf shape, and a herbarium shows each shape better than a word. Six taped paper sheets hold pressed leaves drawn in SVG, from needle to compound. Ticking one straightens the sheet, brings the dried leaf back to fresh green and draws a pencil loop around its label with a stroke animation.

The first colour is the fresh green and the second the paper. Swap the leaves for flowers, seeds or mushrooms by editing the SVG paths, and keep the labels short so the pencil loop wraps them neatly.

## Code

### HTML

```html
<fieldset class="uvq05-hb"><legend>Leaf shape</legend><div class="gr"><label style="--r:-2deg"><input type="checkbox"><span class="sh"><i class="tp" aria-hidden="true"></i><svg class="lf" viewBox="0 0 40 50" aria-hidden="true"><path class="s" d="M20 49V10"/><path class="v" style="stroke-width:1.6" d="M20 14l-8-7M20 14l8-7M20 21l-10-6M20 21l10-6M20 28l-10-6M20 28l10-6M20 35l-9-6M20 35l9-6M20 42l-7-5M20 42l7-5"/></svg><span class="nm">Needle<svg class="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1"/></svg></span></span></label><label style="--r:1.5deg"><input type="checkbox" checked><span class="sh"><i class="tp" aria-hidden="true"></i><svg class="lf" viewBox="0 0 40 50" aria-hidden="true"><path class="b" d="M20 3C29 13 29 30 20 42C11 30 11 13 20 3Z"/><path class="v" d="M20 6V42M20 16l-4-3M20 16l4-3M20 24l-5-4M20 24l5-4M20 32l-4-3M20 32l4-3"/><path class="s" d="M20 42v7"/></svg><span class="nm">Lanceolate<svg class="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1"/></svg></span></span></label><label style="--r:-1deg"><input type="checkbox"><span class="sh"><i class="tp" aria-hidden="true"></i><svg class="lf" viewBox="0 0 40 50" aria-hidden="true"><path class="b" d="M20 4C31 12 37 22 33 31c-3 6-10 6-13 1-3 5-10 5-13-1C3 22 9 12 20 4Z"/><path class="v" d="M20 7V32M20 16l-6-4M20 16l6-4M20 24l-8-4M20 24l8-4"/><path class="s" d="M20 32v17"/></svg><span class="nm">Heart-shaped<svg class="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1"/></svg></span></span></label><label style="--r:2deg"><input type="checkbox"><span class="sh"><i class="tp" aria-hidden="true"></i><svg class="lf" viewBox="0 0 40 50" aria-hidden="true"><path class="b" d="M20 3c4 2 2 6 6 7s5 4 3 7 5 3 4 7-4 3-2 6-3 5-7 4-3 5-4 6c-1-1 0-5-4-6s-5-2-7-4 2-4-2-6-1-6 4-7-2-5 3-7 4-4 6-7Z"/><path class="v" d="M20 5V40M20 13l4-3M20 13l-4-3M20 21l6-3M20 21l-6-3M20 29l6-2M20 29l-6-2"/><path class="s" d="M20 40v9"/></svg><span class="nm">Lobed<svg class="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1"/></svg></span></span></label><label style="--r:-1.5deg"><input type="checkbox" checked><span class="sh"><i class="tp" aria-hidden="true"></i><svg class="lf" viewBox="0 0 40 50" aria-hidden="true"><path class="b" d="M20 36l-11 4 2-6-9-5 7-3-4-9 8 3 1-9 6 6 0-11 0 0 4 11 3-7 4 8 6-4-2 9 7 3-8 5 2 6-11-4z"/><path class="v" d="M20 36V8M20 36L8 22M20 36l12-14M20 36L5 31M20 36l15-5"/><path class="s" d="M20 36v13"/></svg><span class="nm">Palmate<svg class="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1"/></svg></span></span></label><label style="--r:1deg"><input type="checkbox"><span class="sh"><i class="tp" aria-hidden="true"></i><svg class="lf" viewBox="0 0 40 50" aria-hidden="true"><path class="s" d="M20 49V5"/><ellipse class="b" cx="13" cy="10" rx="5" ry="2.6" transform="rotate(-25 13 10)"/><ellipse class="b" cx="27" cy="10" rx="5" ry="2.6" transform="rotate(25 27 10)"/><ellipse class="b" cx="13" cy="18" rx="5" ry="2.6" transform="rotate(-25 13 18)"/><ellipse class="b" cx="27" cy="18" rx="5" ry="2.6" transform="rotate(25 27 18)"/><ellipse class="b" cx="13" cy="26" rx="5" ry="2.6" transform="rotate(-25 13 26)"/><ellipse class="b" cx="27" cy="26" rx="5" ry="2.6" transform="rotate(25 27 26)"/><ellipse class="b" cx="13" cy="34" rx="5" ry="2.6" transform="rotate(-25 13 34)"/><ellipse class="b" cx="27" cy="34" rx="5" ry="2.6" transform="rotate(25 27 34)"/><ellipse class="b" cx="20" cy="4" rx="2.6" ry="4.5"/></svg><span class="nm">Compound<svg class="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1"/></svg></span></span></label></div><p class="ct"><span>Leaves chosen:</span> <span class="n"></span></p></fieldset>
```

### CSS

```css
.uvq05-hb {
  --c1: #3f8f46;
  --c2: #f6f0de;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq05-hb {
  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;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 17em;
  counter-reset: uvq05-hb;
}

.uvq05-hb legend {
  padding: 0;
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq05-hb .gr {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: .7em .55em;
}

.uvq05-hb label {
  position: relative;
  cursor: pointer;
}

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

.uvq05-hb input:checked {
  counter-increment: uvq05-hb;
}

.uvq05-hb .sh {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6em .3em .45em;
  border-radius: .15em;
  background: radial-gradient(rgba(120,90,40,.06) 1px,transparent 1.3px) 0 0/.3em .3em,var(--c2);
  box-shadow: 0 .1em .2em rgba(0,0,0,.18),0 .6em 1em -.7em rgba(0,0,0,.4);
  transform: rotate(var(--r));
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1),box-shadow calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .tp {
  position: absolute;
  top: -.3em;
  left: 50%;
  width: 1.8em;
  height: .55em;
  margin-left: -.9em;
  background: rgba(235,225,190,.75);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  transform: rotate(calc(var(--r) * -2));
}

.uvq05-hb .lf {
  display: block;
  width: 2.6em;
  height: 3.25em;
  overflow: visible;
}

.uvq05-hb .lf .b {
  fill: #9a8656;
  transition: fill calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .lf .v {
  fill: none;
  stroke: #6e5d36;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .lf .s {
  fill: none;
  stroke: #9a8656;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .nm {
  position: relative;
  margin-top: .35em;
  padding: 0 .2em;
  font: italic .62em Georgia,"Iowan Old Style","Times New Roman",serif;
  color: #4a3f2a;
}

.uvq05-hb .pc {
  position: absolute;
  left: -.6em;
  right: -.6em;
  top: -.35em;
  width: calc(100% + 1.2em);
  height: calc(100% + .7em);
  overflow: visible;
  fill: none;
  stroke: #5b5b5b;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb label:hover .sh {
  transform: rotate(0) translateY(-.15em);
}

.uvq05-hb label:active .sh {
  transform: scale(.95);
}

.uvq05-hb input:checked+.sh {
  transform: rotate(0) translateY(-.2em);
  box-shadow: 0 .15em .3em rgba(0,0,0,.2),0 1em 1.4em -.8em rgba(0,0,0,.5);
}

.uvq05-hb input:checked+.sh .lf .b {
  fill: var(--c1);
}

.uvq05-hb input:checked+.sh .lf .v {
  stroke: color-mix(in srgb,var(--c1) 55%,#0b2a0e);
}

.uvq05-hb input:checked+.sh .lf .s {
  stroke: var(--c1);
}

.uvq05-hb input:checked+.sh .pc {
  stroke-dashoffset: 0;
}

.uvq05-hb input:focus-visible+.sh {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-hb .ct {
  margin: .8em 0 0;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq05-hb .n::before {
  content: counter(uvq05-hb);
  font-weight: 800;
  color: var(--fg);
}

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

### React

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

const css = `
.uvq05-hb {
  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;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 17em;
  counter-reset: uvq05-hb;
}

.uvq05-hb legend {
  padding: 0;
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq05-hb .gr {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: .7em .55em;
}

.uvq05-hb label {
  position: relative;
  cursor: pointer;
}

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

.uvq05-hb input:checked {
  counter-increment: uvq05-hb;
}

.uvq05-hb .sh {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6em .3em .45em;
  border-radius: .15em;
  background: radial-gradient(rgba(120,90,40,.06) 1px,transparent 1.3px) 0 0/.3em .3em,var(--c2);
  box-shadow: 0 .1em .2em rgba(0,0,0,.18),0 .6em 1em -.7em rgba(0,0,0,.4);
  transform: rotate(var(--r));
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1),box-shadow calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .tp {
  position: absolute;
  top: -.3em;
  left: 50%;
  width: 1.8em;
  height: .55em;
  margin-left: -.9em;
  background: rgba(235,225,190,.75);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  transform: rotate(calc(var(--r) * -2));
}

.uvq05-hb .lf {
  display: block;
  width: 2.6em;
  height: 3.25em;
  overflow: visible;
}

.uvq05-hb .lf .b {
  fill: #9a8656;
  transition: fill calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .lf .v {
  fill: none;
  stroke: #6e5d36;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .lf .s {
  fill: none;
  stroke: #9a8656;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .nm {
  position: relative;
  margin-top: .35em;
  padding: 0 .2em;
  font: italic .62em Georgia,"Iowan Old Style","Times New Roman",serif;
  color: #4a3f2a;
}

.uvq05-hb .pc {
  position: absolute;
  left: -.6em;
  right: -.6em;
  top: -.35em;
  width: calc(100% + 1.2em);
  height: calc(100% + .7em);
  overflow: visible;
  fill: none;
  stroke: #5b5b5b;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb label:hover .sh {
  transform: rotate(0) translateY(-.15em);
}

.uvq05-hb label:active .sh {
  transform: scale(.95);
}

.uvq05-hb input:checked+.sh {
  transform: rotate(0) translateY(-.2em);
  box-shadow: 0 .15em .3em rgba(0,0,0,.2),0 1em 1.4em -.8em rgba(0,0,0,.5);
}

.uvq05-hb input:checked+.sh .lf .b {
  fill: var(--c1);
}

.uvq05-hb input:checked+.sh .lf .v {
  stroke: color-mix(in srgb,var(--c1) 55%,#0b2a0e);
}

.uvq05-hb input:checked+.sh .lf .s {
  stroke: var(--c1);
}

.uvq05-hb input:checked+.sh .pc {
  stroke-dashoffset: 0;
}

.uvq05-hb input:focus-visible+.sh {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-hb .ct {
  margin: .8em 0 0;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq05-hb .n::before {
  content: counter(uvq05-hb);
  font-weight: 800;
  color: var(--fg);
}

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

export default function FHerbarium() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#3f8f46",
          "--c2": "#f6f0de",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq05-hb"><legend>Leaf shape</legend><div className="gr"><label style={{ "--r": "-2deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="s" d="M20 49V10" /><path className="v" style={{ strokeWidth: "1.6" }} d="M20 14l-8-7M20 14l8-7M20 21l-10-6M20 21l10-6M20 28l-10-6M20 28l10-6M20 35l-9-6M20 35l9-6M20 42l-7-5M20 42l7-5" /></svg><span className="nm">Needle<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "1.5deg" } as CSSProperties}><input type="checkbox" checked={true} /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 3C29 13 29 30 20 42C11 30 11 13 20 3Z" /><path className="v" d="M20 6V42M20 16l-4-3M20 16l4-3M20 24l-5-4M20 24l5-4M20 32l-4-3M20 32l4-3" /><path className="s" d="M20 42v7" /></svg><span className="nm">Lanceolate<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "-1deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 4C31 12 37 22 33 31c-3 6-10 6-13 1-3 5-10 5-13-1C3 22 9 12 20 4Z" /><path className="v" d="M20 7V32M20 16l-6-4M20 16l6-4M20 24l-8-4M20 24l8-4" /><path className="s" d="M20 32v17" /></svg><span className="nm">Heart-shaped<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "2deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 3c4 2 2 6 6 7s5 4 3 7 5 3 4 7-4 3-2 6-3 5-7 4-3 5-4 6c-1-1 0-5-4-6s-5-2-7-4 2-4-2-6-1-6 4-7-2-5 3-7 4-4 6-7Z" /><path className="v" d="M20 5V40M20 13l4-3M20 13l-4-3M20 21l6-3M20 21l-6-3M20 29l6-2M20 29l-6-2" /><path className="s" d="M20 40v9" /></svg><span className="nm">Lobed<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "-1.5deg" } as CSSProperties}><input type="checkbox" checked={true} /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 36l-11 4 2-6-9-5 7-3-4-9 8 3 1-9 6 6 0-11 0 0 4 11 3-7 4 8 6-4-2 9 7 3-8 5 2 6-11-4z" /><path className="v" d="M20 36V8M20 36L8 22M20 36l12-14M20 36L5 31M20 36l15-5" /><path className="s" d="M20 36v13" /></svg><span className="nm">Palmate<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "1deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="s" d="M20 49V5" /><ellipse className="b" cx="13" cy="10" rx="5" ry="2.6" transform="rotate(-25 13 10)" /><ellipse className="b" cx="27" cy="10" rx="5" ry="2.6" transform="rotate(25 27 10)" /><ellipse className="b" cx="13" cy="18" rx="5" ry="2.6" transform="rotate(-25 13 18)" /><ellipse className="b" cx="27" cy="18" rx="5" ry="2.6" transform="rotate(25 27 18)" /><ellipse className="b" cx="13" cy="26" rx="5" ry="2.6" transform="rotate(-25 13 26)" /><ellipse className="b" cx="27" cy="26" rx="5" ry="2.6" transform="rotate(25 27 26)" /><ellipse className="b" cx="13" cy="34" rx="5" ry="2.6" transform="rotate(-25 13 34)" /><ellipse className="b" cx="27" cy="34" rx="5" ry="2.6" transform="rotate(25 27 34)" /><ellipse className="b" cx="20" cy="4" rx="2.6" ry="4.5" /></svg><span className="nm">Compound<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label></div><p className="ct"><span>Leaves chosen:</span> <span className="n"></span></p></fieldset>
      </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 “Herbarium leaf shape filter” block (Filters) from AIMRAN Library to my project.

## What it is
Herbarium sheets with pressed leaves: tick a shape and the leaf turns green again while its name gets circled in pencil.

## Chosen settings
- Main color: #3f8f46
- Secondary color: #f6f0de
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Forma de la hoja"

## 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 = `
.uvq05-hb {
  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;
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  width: 17em;
  counter-reset: uvq05-hb;
}

.uvq05-hb legend {
  padding: 0;
  margin: 0 0 .8em;
  font-weight: 700;
}

.uvq05-hb .gr {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: .7em .55em;
}

.uvq05-hb label {
  position: relative;
  cursor: pointer;
}

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

.uvq05-hb input:checked {
  counter-increment: uvq05-hb;
}

.uvq05-hb .sh {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .6em .3em .45em;
  border-radius: .15em;
  background: radial-gradient(rgba(120,90,40,.06) 1px,transparent 1.3px) 0 0/.3em .3em,var(--c2);
  box-shadow: 0 .1em .2em rgba(0,0,0,.18),0 .6em 1em -.7em rgba(0,0,0,.4);
  transform: rotate(var(--r));
  transition: transform calc(0.45s / var(--k)) cubic-bezier(.34,1.56,.64,1),box-shadow calc(0.45s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .tp {
  position: absolute;
  top: -.3em;
  left: 50%;
  width: 1.8em;
  height: .55em;
  margin-left: -.9em;
  background: rgba(235,225,190,.75);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04);
  transform: rotate(calc(var(--r) * -2));
}

.uvq05-hb .lf {
  display: block;
  width: 2.6em;
  height: 3.25em;
  overflow: visible;
}

.uvq05-hb .lf .b {
  fill: #9a8656;
  transition: fill calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .lf .v {
  fill: none;
  stroke: #6e5d36;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .lf .s {
  fill: none;
  stroke: #9a8656;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: stroke calc(0.5s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb .nm {
  position: relative;
  margin-top: .35em;
  padding: 0 .2em;
  font: italic .62em Georgia,"Iowan Old Style","Times New Roman",serif;
  color: #4a3f2a;
}

.uvq05-hb .pc {
  position: absolute;
  left: -.6em;
  right: -.6em;
  top: -.35em;
  width: calc(100% + 1.2em);
  height: calc(100% + .7em);
  overflow: visible;
  fill: none;
  stroke: #5b5b5b;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset calc(0.6s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq05-hb label:hover .sh {
  transform: rotate(0) translateY(-.15em);
}

.uvq05-hb label:active .sh {
  transform: scale(.95);
}

.uvq05-hb input:checked+.sh {
  transform: rotate(0) translateY(-.2em);
  box-shadow: 0 .15em .3em rgba(0,0,0,.2),0 1em 1.4em -.8em rgba(0,0,0,.5);
}

.uvq05-hb input:checked+.sh .lf .b {
  fill: var(--c1);
}

.uvq05-hb input:checked+.sh .lf .v {
  stroke: color-mix(in srgb,var(--c1) 55%,#0b2a0e);
}

.uvq05-hb input:checked+.sh .lf .s {
  stroke: var(--c1);
}

.uvq05-hb input:checked+.sh .pc {
  stroke-dashoffset: 0;
}

.uvq05-hb input:focus-visible+.sh {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq05-hb .ct {
  margin: .8em 0 0;
  font-size: .8em;
  color: color-mix(in srgb,var(--fg) 58%,transparent);
}

.uvq05-hb .n::before {
  content: counter(uvq05-hb);
  font-weight: 800;
  color: var(--fg);
}

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

export default function FHerbarium() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#3f8f46",
          "--c2": "#f6f0de",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq05-hb"><legend>Leaf shape</legend><div className="gr"><label style={{ "--r": "-2deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="s" d="M20 49V10" /><path className="v" style={{ strokeWidth: "1.6" }} d="M20 14l-8-7M20 14l8-7M20 21l-10-6M20 21l10-6M20 28l-10-6M20 28l10-6M20 35l-9-6M20 35l9-6M20 42l-7-5M20 42l7-5" /></svg><span className="nm">Needle<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "1.5deg" } as CSSProperties}><input type="checkbox" checked={true} /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 3C29 13 29 30 20 42C11 30 11 13 20 3Z" /><path className="v" d="M20 6V42M20 16l-4-3M20 16l4-3M20 24l-5-4M20 24l5-4M20 32l-4-3M20 32l4-3" /><path className="s" d="M20 42v7" /></svg><span className="nm">Lanceolate<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "-1deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 4C31 12 37 22 33 31c-3 6-10 6-13 1-3 5-10 5-13-1C3 22 9 12 20 4Z" /><path className="v" d="M20 7V32M20 16l-6-4M20 16l6-4M20 24l-8-4M20 24l8-4" /><path className="s" d="M20 32v17" /></svg><span className="nm">Heart-shaped<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "2deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 3c4 2 2 6 6 7s5 4 3 7 5 3 4 7-4 3-2 6-3 5-7 4-3 5-4 6c-1-1 0-5-4-6s-5-2-7-4 2-4-2-6-1-6 4-7-2-5 3-7 4-4 6-7Z" /><path className="v" d="M20 5V40M20 13l4-3M20 13l-4-3M20 21l6-3M20 21l-6-3M20 29l6-2M20 29l-6-2" /><path className="s" d="M20 40v9" /></svg><span className="nm">Lobed<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "-1.5deg" } as CSSProperties}><input type="checkbox" checked={true} /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="b" d="M20 36l-11 4 2-6-9-5 7-3-4-9 8 3 1-9 6 6 0-11 0 0 4 11 3-7 4 8 6-4-2 9 7 3-8 5 2 6-11-4z" /><path className="v" d="M20 36V8M20 36L8 22M20 36l12-14M20 36L5 31M20 36l15-5" /><path className="s" d="M20 36v13" /></svg><span className="nm">Palmate<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label><label style={{ "--r": "1deg" } as CSSProperties}><input type="checkbox" /><span className="sh"><i className="tp" aria-hidden="true"></i><svg className="lf" viewBox="0 0 40 50" aria-hidden="true"><path className="s" d="M20 49V5" /><ellipse className="b" cx="13" cy="10" rx="5" ry="2.6" transform="rotate(-25 13 10)" /><ellipse className="b" cx="27" cy="10" rx="5" ry="2.6" transform="rotate(25 27 10)" /><ellipse className="b" cx="13" cy="18" rx="5" ry="2.6" transform="rotate(-25 13 18)" /><ellipse className="b" cx="27" cy="18" rx="5" ry="2.6" transform="rotate(25 27 18)" /><ellipse className="b" cx="13" cy="26" rx="5" ry="2.6" transform="rotate(-25 13 26)" /><ellipse className="b" cx="27" cy="26" rx="5" ry="2.6" transform="rotate(25 27 26)" /><ellipse className="b" cx="13" cy="34" rx="5" ry="2.6" transform="rotate(-25 13 34)" /><ellipse className="b" cx="27" cy="34" rx="5" ry="2.6" transform="rotate(25 27 34)" /><ellipse className="b" cx="20" cy="4" rx="2.6" ry="4.5" /></svg><span className="nm">Compound<svg className="pc" viewBox="0 0 100 30" preserveAspectRatio="none" aria-hidden="true"><path d="M8 17C9 6 52 3 88 8c12 3 10 14-4 17-30 5-70 4-78-4C2 17 8 10 22 7" pathLength="1" /></svg></span></span></label></div><p className="ct"><span>Leaves chosen:</span> <span className="n"></span></p></fieldset>
      </div>
    </>
  );
}
```

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