# Ink drop brush picker

> On rice paper, a drop of sumi ink falls and spreads on the chosen option and changes the brush stroke width.

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

## Where to use it

Three brush widths sit on warm rice paper with a small red seal in the corner. Choosing one drops a bead of ink that falls into the circle and blooms into a rough blot, using an SVG turbulence filter for the ragged edge. The sample stroke above redraws itself at the new width, which suits drawing apps, stationery and calm editorial sites.

The main color is the ink and the secondary color the seal, so indigo or sepia ink also look natural. The filter lives inside the block with a prefixed id; keep one per page, and rename the three options to pens, nibs or line weights.

## Code

### HTML

```html
<fieldset class="uvq04-ink"><legend>Stroke width</legend><svg class="fx" width="0" height="0" aria-hidden="true"><filter id="uvq04-ink-f"><feTurbulence type="fractalNoise" baseFrequency=".8" numOctaves="2" seed="4"/><feDisplacementMap in="SourceGraphic" scale="5"/></filter></svg><svg class="pv" viewBox="0 0 200 46" aria-hidden="true"><path pathLength="1" d="M14 32C42 6 64 42 94 22S152 6 186 28"/></svg><span class="hk" aria-hidden="true">墨</span><div class="op"><label><input type="radio" name="uvq04-ink"><span class="dt" aria-hidden="true"></span><span class="tx">Fine brush</span></label><label><input type="radio" name="uvq04-ink" checked><span class="dt" aria-hidden="true"></span><span class="tx">Medium brush</span></label><label><input type="radio" name="uvq04-ink"><span class="dt" aria-hidden="true"></span><span class="tx">Wide brush</span></label></div></fieldset>
```

### CSS

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

.uvq04-ink {
  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: 1em 1.1em 1.1em;
  border-radius: .4em;
  color: var(--c1);
  background: radial-gradient(circle at 20% 10%,rgba(255,255,255,.6),transparent 40%),repeating-linear-gradient(37deg,rgba(120,90,40,.035) 0 2px,transparent 2px 7px),#f3ede1;
  box-shadow: 0 1px 0 rgba(0,0,0,.05),0 1em 2em -1.2em rgba(0,0,0,.5);
}

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

.uvq04-ink .fx {
  position: absolute;
  width: 0;
  height: 0;
}

.uvq04-ink .pv {
  clear: both;
  display: block;
  width: 100%;
  height: 3.2em;
  overflow: visible;
}

.uvq04-ink .pv path {
  fill: none;
  stroke: var(--c1);
  stroke-width: var(--w,5);
  stroke-linecap: round;
  filter: url(#uvq04-ink-f);
  stroke-dasharray: 1;
  transition: stroke-width calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .hk {
  position: absolute;
  right: 1em;
  top: .85em;
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: .2em;
  font-size: .8em;
  color: #fff6ee;
  background: var(--c2);
  transform: rotate(4deg);
  opacity: .9;
}

.uvq04-ink .op {
  display: flex;
  justify-content: space-between;
  margin-top: .5em;
}

.uvq04-ink label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4em;
  width: 4.8em;
  cursor: pointer;
}

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

.uvq04-ink .dt {
  position: relative;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--c1) 40%,transparent);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .dt::before {
  content: "";
  position: absolute;
  inset: .1em;
  border-radius: 50%;
  background: var(--c1);
  filter: url(#uvq04-ink-f);
  transform: scale(0);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .dt::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .4em;
  height: .55em;
  margin: -.3em 0 0 -.2em;
  border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
  background: var(--c1);
  opacity: 0;
}

.uvq04-ink .tx {
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: .8em;
  font-style: italic;
  white-space: nowrap;
  opacity: .7;
}

.uvq04-ink label:hover .dt {
  box-shadow: inset 0 0 0 1.5px var(--c1);
}

.uvq04-ink label:active .dt {
  transform: scale(.92);
}

.uvq04-ink input:checked + .dt::before {
  transform: scale(1);
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.34,1.56,.64,1) calc(0.3s / var(--k));
}

.uvq04-ink input:checked + .dt::after {
  animation: uvq04-ink-d calc(0.32s / var(--k)) cubic-bezier(.5,0,1,1);
}

.uvq04-ink input:checked ~ .tx {
  opacity: 1;
  font-weight: 700;
}

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

.uvq04-ink:has(label:nth-of-type(1) input:checked) .pv path {
  --w: 2;
  animation: uvq04-ink1 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq04-ink:has(label:nth-of-type(2) input:checked) .pv path {
  --w: 5;
  animation: uvq04-ink2 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq04-ink:has(label:nth-of-type(3) input:checked) .pv path {
  --w: 9;
  animation: uvq04-ink3 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq04-ink1 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink2 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink3 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink-d {
  0% {
    transform: translateY(-2.4em);
    opacity: 1;
  }
  90% {
    transform: translateY(0) scaleY(.7);
    opacity: 1;
  }
  100% {
    transform: scale(1.4,.4);
    opacity: 0;
  }
}

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

### React

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

const css = `
.uvq04-ink {
  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: 1em 1.1em 1.1em;
  border-radius: .4em;
  color: var(--c1);
  background: radial-gradient(circle at 20% 10%,rgba(255,255,255,.6),transparent 40%),repeating-linear-gradient(37deg,rgba(120,90,40,.035) 0 2px,transparent 2px 7px),#f3ede1;
  box-shadow: 0 1px 0 rgba(0,0,0,.05),0 1em 2em -1.2em rgba(0,0,0,.5);
}

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

.uvq04-ink .fx {
  position: absolute;
  width: 0;
  height: 0;
}

.uvq04-ink .pv {
  clear: both;
  display: block;
  width: 100%;
  height: 3.2em;
  overflow: visible;
}

.uvq04-ink .pv path {
  fill: none;
  stroke: var(--c1);
  stroke-width: var(--w,5);
  stroke-linecap: round;
  filter: url(#uvq04-ink-f);
  stroke-dasharray: 1;
  transition: stroke-width calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .hk {
  position: absolute;
  right: 1em;
  top: .85em;
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: .2em;
  font-size: .8em;
  color: #fff6ee;
  background: var(--c2);
  transform: rotate(4deg);
  opacity: .9;
}

.uvq04-ink .op {
  display: flex;
  justify-content: space-between;
  margin-top: .5em;
}

.uvq04-ink label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4em;
  width: 4.8em;
  cursor: pointer;
}

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

.uvq04-ink .dt {
  position: relative;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--c1) 40%,transparent);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .dt::before {
  content: "";
  position: absolute;
  inset: .1em;
  border-radius: 50%;
  background: var(--c1);
  filter: url(#uvq04-ink-f);
  transform: scale(0);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .dt::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .4em;
  height: .55em;
  margin: -.3em 0 0 -.2em;
  border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
  background: var(--c1);
  opacity: 0;
}

.uvq04-ink .tx {
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: .8em;
  font-style: italic;
  white-space: nowrap;
  opacity: .7;
}

.uvq04-ink label:hover .dt {
  box-shadow: inset 0 0 0 1.5px var(--c1);
}

.uvq04-ink label:active .dt {
  transform: scale(.92);
}

.uvq04-ink input:checked + .dt::before {
  transform: scale(1);
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.34,1.56,.64,1) calc(0.3s / var(--k));
}

.uvq04-ink input:checked + .dt::after {
  animation: uvq04-ink-d calc(0.32s / var(--k)) cubic-bezier(.5,0,1,1);
}

.uvq04-ink input:checked ~ .tx {
  opacity: 1;
  font-weight: 700;
}

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

.uvq04-ink:has(label:nth-of-type(1) input:checked) .pv path {
  --w: 2;
  animation: uvq04-ink1 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq04-ink:has(label:nth-of-type(2) input:checked) .pv path {
  --w: 5;
  animation: uvq04-ink2 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq04-ink:has(label:nth-of-type(3) input:checked) .pv path {
  --w: 9;
  animation: uvq04-ink3 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq04-ink1 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink2 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink3 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink-d {
  0% {
    transform: translateY(-2.4em);
    opacity: 1;
  }
  90% {
    transform: translateY(0) scaleY(.7);
    opacity: 1;
  }
  100% {
    transform: scale(1.4,.4);
    opacity: 0;
  }
}

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

export default function RdInkDrop() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#161412",
          "--c2": "#c8372d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq04-ink"><legend>Stroke width</legend><svg className="fx" width="0" height="0" aria-hidden="true"><filter id="uvq04-ink-f"><feTurbulence type="fractalNoise" baseFrequency=".8" numOctaves="2" seed="4" /><feDisplacementMap in="SourceGraphic" scale="5" /></filter></svg><svg className="pv" viewBox="0 0 200 46" aria-hidden="true"><path pathLength="1" d="M14 32C42 6 64 42 94 22S152 6 186 28" /></svg><span className="hk" aria-hidden="true">墨</span><div className="op"><label><input type="radio" name="uvq04-ink" /><span className="dt" aria-hidden="true"></span><span className="tx">Fine brush</span></label><label><input type="radio" name="uvq04-ink" checked={true} /><span className="dt" aria-hidden="true"></span><span className="tx">Medium brush</span></label><label><input type="radio" name="uvq04-ink" /><span className="dt" aria-hidden="true"></span><span className="tx">Wide brush</span></label></div></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 “Ink drop brush picker” block (Radio buttons) from AIMRAN Library to my project.

## What it is
On rice paper, a drop of sumi ink falls and spreads on the chosen option and changes the brush stroke width.

## Chosen settings
- Main color: #161412
- Secondary color: #c8372d
- Size: 16px (from 12 to 24px)
- Speed: 1x (from 0.5 to 2x)
- Text: "Grosor del trazo"

## 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-ink {
  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: 1em 1.1em 1.1em;
  border-radius: .4em;
  color: var(--c1);
  background: radial-gradient(circle at 20% 10%,rgba(255,255,255,.6),transparent 40%),repeating-linear-gradient(37deg,rgba(120,90,40,.035) 0 2px,transparent 2px 7px),#f3ede1;
  box-shadow: 0 1px 0 rgba(0,0,0,.05),0 1em 2em -1.2em rgba(0,0,0,.5);
}

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

.uvq04-ink .fx {
  position: absolute;
  width: 0;
  height: 0;
}

.uvq04-ink .pv {
  clear: both;
  display: block;
  width: 100%;
  height: 3.2em;
  overflow: visible;
}

.uvq04-ink .pv path {
  fill: none;
  stroke: var(--c1);
  stroke-width: var(--w,5);
  stroke-linecap: round;
  filter: url(#uvq04-ink-f);
  stroke-dasharray: 1;
  transition: stroke-width calc(0.4s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .hk {
  position: absolute;
  right: 1em;
  top: .85em;
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: .2em;
  font-size: .8em;
  color: #fff6ee;
  background: var(--c2);
  transform: rotate(4deg);
  opacity: .9;
}

.uvq04-ink .op {
  display: flex;
  justify-content: space-between;
  margin-top: .5em;
}

.uvq04-ink label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4em;
  width: 4.8em;
  cursor: pointer;
}

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

.uvq04-ink .dt {
  position: relative;
  width: 1.9em;
  height: 1.9em;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb,var(--c1) 40%,transparent);
  transition: transform calc(0.2s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .dt::before {
  content: "";
  position: absolute;
  inset: .1em;
  border-radius: 50%;
  background: var(--c1);
  filter: url(#uvq04-ink-f);
  transform: scale(0);
  transition: transform calc(0.3s / var(--k)) cubic-bezier(.25,.1,.25,1);
}

.uvq04-ink .dt::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .4em;
  height: .55em;
  margin: -.3em 0 0 -.2em;
  border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
  background: var(--c1);
  opacity: 0;
}

.uvq04-ink .tx {
  font-family: "Iowan Old Style",Georgia,"Times New Roman",serif;
  font-size: .8em;
  font-style: italic;
  white-space: nowrap;
  opacity: .7;
}

.uvq04-ink label:hover .dt {
  box-shadow: inset 0 0 0 1.5px var(--c1);
}

.uvq04-ink label:active .dt {
  transform: scale(.92);
}

.uvq04-ink input:checked + .dt::before {
  transform: scale(1);
  transition: transform calc(0.55s / var(--k)) cubic-bezier(.34,1.56,.64,1) calc(0.3s / var(--k));
}

.uvq04-ink input:checked + .dt::after {
  animation: uvq04-ink-d calc(0.32s / var(--k)) cubic-bezier(.5,0,1,1);
}

.uvq04-ink input:checked ~ .tx {
  opacity: 1;
  font-weight: 700;
}

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

.uvq04-ink:has(label:nth-of-type(1) input:checked) .pv path {
  --w: 2;
  animation: uvq04-ink1 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq04-ink:has(label:nth-of-type(2) input:checked) .pv path {
  --w: 5;
  animation: uvq04-ink2 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

.uvq04-ink:has(label:nth-of-type(3) input:checked) .pv path {
  --w: 9;
  animation: uvq04-ink3 calc(0.8s / var(--k)) cubic-bezier(.22,1,.36,1);
}

@keyframes uvq04-ink1 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink2 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink3 {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes uvq04-ink-d {
  0% {
    transform: translateY(-2.4em);
    opacity: 1;
  }
  90% {
    transform: translateY(0) scaleY(.7);
    opacity: 1;
  }
  100% {
    transform: scale(1.4,.4);
    opacity: 0;
  }
}

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

export default function RdInkDrop() {
  return (
    <>
      <style>{css}</style>
      <div
        style={{
          "--c1": "#161412",
          "--c2": "#c8372d",
          "--s": "16px",
          "--k": "1",
          "--fg": "#1d1d1f",
          "--bg": "#f5f5f7",
        } as CSSProperties}
      >
        <fieldset className="uvq04-ink"><legend>Stroke width</legend><svg className="fx" width="0" height="0" aria-hidden="true"><filter id="uvq04-ink-f"><feTurbulence type="fractalNoise" baseFrequency=".8" numOctaves="2" seed="4" /><feDisplacementMap in="SourceGraphic" scale="5" /></filter></svg><svg className="pv" viewBox="0 0 200 46" aria-hidden="true"><path pathLength="1" d="M14 32C42 6 64 42 94 22S152 6 186 28" /></svg><span className="hk" aria-hidden="true">墨</span><div className="op"><label><input type="radio" name="uvq04-ink" /><span className="dt" aria-hidden="true"></span><span className="tx">Fine brush</span></label><label><input type="radio" name="uvq04-ink" checked={true} /><span className="dt" aria-hidden="true"></span><span className="tx">Medium brush</span></label><label><input type="radio" name="uvq04-ink" /><span className="dt" aria-hidden="true"></span><span className="tx">Wide brush</span></label></div></fieldset>
      </div>
    </>
  );
}
```

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