# Pencil answer sheet radio

> A multiple choice exam question: when you pick an answer, a pencil scribble fills its oval.

- Category: [Radio buttons](https://library.aimran.es/components/radios)
- Built with: HTML + CSS
- Live editor: https://library.aimran.es/blocks/uv-rd-bubble-sheet
- Library: AIMRAN Library (https://library.aimran.es), free, no sign-up, by Aimran Oukham

## Where to use it

This radio group looks like an optical answer sheet: salmon printed ovals, timing marks down the margin, faint ruled lines and a serif question. Picking an answer draws a graphite scribble inside the oval with an SVG stroke, and picking another one erases it. It suits quizzes, school platforms, surveys and onboarding questions that want a tactile, offline feel.

The main color is the pencil and the secondary color is the printed ink of the sheet. Change the question through the text field and keep answers to one line; four or five options fit the card without scrolling.

## Code

### HTML

```html
<fieldset class="uvq04-omr"><legend>7. Which gas do plants absorb?</legend><label><input type="radio" name="uvq04-omr"><span class="bb" aria-hidden="true">A<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18"/></svg></span><span class="tx">Oxygen</span></label><label><input type="radio" name="uvq04-omr" checked><span class="bb" aria-hidden="true">B<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18"/></svg></span><span class="tx">Carbon dioxide</span></label><label><input type="radio" name="uvq04-omr"><span class="bb" aria-hidden="true">C<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18"/></svg></span><span class="tx">Nitrogen</span></label><label><input type="radio" name="uvq04-omr"><span class="bb" aria-hidden="true">D<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18"/></svg></span><span class="tx">Helium</span></label><p class="nt">Fill the oval completely</p></fieldset>
```

### CSS

```css
.uvq04-omr {
  --c1: #34363c;
  --c2: #e2725b;
  --s: 16px;
  /* tamaño */
  --k: 1;
  /* velocidad */
  --fg: #1d1d1f;
  /* texto */
  --bg: #f5f5f7;
  /* fondo */
}

.uvq04-omr {
  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;
  position: relative;
  width: 17em;
  padding: 1.1em 1.2em 1em 2.1em;
  border-radius: .3em;
  color: #2a2a2a;
  background: linear-gradient(90deg,transparent 1.5em,color-mix(in srgb,var(--c2) 40%,transparent) 0 calc(1.5em + 1px),transparent 0),repeating-linear-gradient(transparent 0 1.55em,color-mix(in srgb,var(--c2) 18%,transparent) 0 calc(1.55em + 1px)),#fbf8ef;
  box-shadow: 0 1px 0 rgba(0,0,0,.06),0 1em 2em -1.2em rgba(0,0,0,.45);
}

.uvq04-omr legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: .8em;
  font-weight: 700;
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: 1.02em;
}

.uvq04-omr legend + label {
  clear: both;
}

.uvq04-omr label {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .42em .3em;
  border-radius: .4em;
  cursor: pointer;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-omr label::before {
  content: "";
  position: absolute;
  left: -1.55em;
  top: 50%;
  width: .7em;
  height: .32em;
  margin-top: -.16em;
  background: #1d1d1d;
}

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

.uvq04-omr .bb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 1.65em;
  border: 1.5px solid var(--c2);
  border-radius: 50%;
  font-size: .72em;
  font-weight: 700;
  color: var(--c2);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-omr .bb svg {
  position: absolute;
  inset: -.15em -.1em;
  width: calc(100% + .2em);
  height: calc(100% + .3em);
  fill: none;
  stroke: var(--c1);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .88;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.5s / var(--k)) cubic-bezier(.5,0,.6,1);
}

.uvq04-omr .tx {
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: 1em;
}

.uvq04-omr label:hover {
  background: color-mix(in srgb,var(--c2) 8%,transparent);
}

.uvq04-omr label:hover .bb {
  background: color-mix(in srgb,var(--c2) 12%,transparent);
}

.uvq04-omr label:active .bb {
  transform: scale(.94);
}

.uvq04-omr input:checked + .bb svg {
  stroke-dashoffset: 0;
}

.uvq04-omr input:focus-visible + .bb {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq04-omr .nt {
  margin: .7em 0 0;
  font-size: .68em;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c2);
}

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

### React

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

const css = `
.uvq04-omr {
  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;
  position: relative;
  width: 17em;
  padding: 1.1em 1.2em 1em 2.1em;
  border-radius: .3em;
  color: #2a2a2a;
  background: linear-gradient(90deg,transparent 1.5em,color-mix(in srgb,var(--c2) 40%,transparent) 0 calc(1.5em + 1px),transparent 0),repeating-linear-gradient(transparent 0 1.55em,color-mix(in srgb,var(--c2) 18%,transparent) 0 calc(1.55em + 1px)),#fbf8ef;
  box-shadow: 0 1px 0 rgba(0,0,0,.06),0 1em 2em -1.2em rgba(0,0,0,.45);
}

.uvq04-omr legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: .8em;
  font-weight: 700;
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: 1.02em;
}

.uvq04-omr legend + label {
  clear: both;
}

.uvq04-omr label {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .42em .3em;
  border-radius: .4em;
  cursor: pointer;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-omr label::before {
  content: "";
  position: absolute;
  left: -1.55em;
  top: 50%;
  width: .7em;
  height: .32em;
  margin-top: -.16em;
  background: #1d1d1d;
}

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

.uvq04-omr .bb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 1.65em;
  border: 1.5px solid var(--c2);
  border-radius: 50%;
  font-size: .72em;
  font-weight: 700;
  color: var(--c2);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-omr .bb svg {
  position: absolute;
  inset: -.15em -.1em;
  width: calc(100% + .2em);
  height: calc(100% + .3em);
  fill: none;
  stroke: var(--c1);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .88;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.5s / var(--k)) cubic-bezier(.5,0,.6,1);
}

.uvq04-omr .tx {
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: 1em;
}

.uvq04-omr label:hover {
  background: color-mix(in srgb,var(--c2) 8%,transparent);
}

.uvq04-omr label:hover .bb {
  background: color-mix(in srgb,var(--c2) 12%,transparent);
}

.uvq04-omr label:active .bb {
  transform: scale(.94);
}

.uvq04-omr input:checked + .bb svg {
  stroke-dashoffset: 0;
}

.uvq04-omr input:focus-visible + .bb {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq04-omr .nt {
  margin: .7em 0 0;
  font-size: .68em;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c2);
}

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

export default function RdBubbleSheet() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#34363c",
          "--c2": "#e2725b",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq04-omr"><legend>7. Which gas do plants absorb?</legend><label><input type="radio" name="uvq04-omr" /><span className="bb" aria-hidden="true">A<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Oxygen</span></label><label><input type="radio" name="uvq04-omr" checked={true} /><span className="bb" aria-hidden="true">B<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Carbon dioxide</span></label><label><input type="radio" name="uvq04-omr" /><span className="bb" aria-hidden="true">C<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Nitrogen</span></label><label><input type="radio" name="uvq04-omr" /><span className="bb" aria-hidden="true">D<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Helium</span></label><p className="nt">Fill the oval completely</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 “Pencil answer sheet radio” block (Radio buttons) from AIMRAN Library to my project.

## What it is
A multiple choice exam question: when you pick an answer, a pencil scribble fills its oval.

## Chosen settings
- Main color: #34363c
- Secondary color: #e2725b
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "7. ¿Qué gas absorben las plantas?"

## 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 = `
.uvq04-omr {
  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;
  position: relative;
  width: 17em;
  padding: 1.1em 1.2em 1em 2.1em;
  border-radius: .3em;
  color: #2a2a2a;
  background: linear-gradient(90deg,transparent 1.5em,color-mix(in srgb,var(--c2) 40%,transparent) 0 calc(1.5em + 1px),transparent 0),repeating-linear-gradient(transparent 0 1.55em,color-mix(in srgb,var(--c2) 18%,transparent) 0 calc(1.55em + 1px)),#fbf8ef;
  box-shadow: 0 1px 0 rgba(0,0,0,.06),0 1em 2em -1.2em rgba(0,0,0,.45);
}

.uvq04-omr legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: .8em;
  font-weight: 700;
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: 1.02em;
}

.uvq04-omr legend + label {
  clear: both;
}

.uvq04-omr label {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8em;
  padding: .42em .3em;
  border-radius: .4em;
  cursor: pointer;
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-omr label::before {
  content: "";
  position: absolute;
  left: -1.55em;
  top: 50%;
  width: .7em;
  height: .32em;
  margin-top: -.16em;
  background: #1d1d1d;
}

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

.uvq04-omr .bb {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5em;
  height: 1.65em;
  border: 1.5px solid var(--c2);
  border-radius: 50%;
  font-size: .72em;
  font-weight: 700;
  color: var(--c2);
  transition: background calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-omr .bb svg {
  position: absolute;
  inset: -.15em -.1em;
  width: calc(100% + .2em);
  height: calc(100% + .3em);
  fill: none;
  stroke: var(--c1);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .88;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset calc(0.5s / var(--k)) cubic-bezier(.5,0,.6,1);
}

.uvq04-omr .tx {
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: 1em;
}

.uvq04-omr label:hover {
  background: color-mix(in srgb,var(--c2) 8%,transparent);
}

.uvq04-omr label:hover .bb {
  background: color-mix(in srgb,var(--c2) 12%,transparent);
}

.uvq04-omr label:active .bb {
  transform: scale(.94);
}

.uvq04-omr input:checked + .bb svg {
  stroke-dashoffset: 0;
}

.uvq04-omr input:focus-visible + .bb {
  outline: 2px solid var(--c1);
  outline-offset: 3px;
}

.uvq04-omr .nt {
  margin: .7em 0 0;
  font-size: .68em;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--c2);
}

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

export default function RdBubbleSheet() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#34363c",
          "--c2": "#e2725b",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq04-omr"><legend>7. Which gas do plants absorb?</legend><label><input type="radio" name="uvq04-omr" /><span className="bb" aria-hidden="true">A<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Oxygen</span></label><label><input type="radio" name="uvq04-omr" checked={true} /><span className="bb" aria-hidden="true">B<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Carbon dioxide</span></label><label><input type="radio" name="uvq04-omr" /><span className="bb" aria-hidden="true">C<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Nitrogen</span></label><label><input type="radio" name="uvq04-omr" /><span className="bb" aria-hidden="true">D<svg viewBox="0 0 24 24" preserveAspectRatio="none"><path pathLength="1" d="M6.5 8.5L17 6.5L5.5 12.5L18.5 10L6 16L18 14L8.5 18" /></svg></span><span className="tx">Helium</span></label><p className="nt">Fill the oval completely</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.
````
