Stepper with a unit
A quantity field with minus and plus buttons, the unit beside the number and a running total under it. The second one has hit its limit and says why.
The code
Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.
<div class="ukc-input-stepper-unit">
<fieldset class="q">
<legend>Saturday standing order</legend>
<div class="item">
<label for="ukc-input-stepper-unit-a">Country sourdough</label>
<p class="hint" id="ukc-input-stepper-unit-ah">Baked in trays of 6. Change it any time before Thursday noon.</p>
<div class="ctl">
<button type="button" aria-label="One tray less of country sourdough"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button>
<span class="val"><input id="ukc-input-stepper-unit-a" type="text" inputmode="numeric" value="4" aria-describedby="ukc-input-stepper-unit-ah"><span class="unit">trays</span></span>
<button type="button" aria-label="One tray more of country sourdough"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button>
</div>
<p class="sum"><span>24 loaves</span><span>$132.00</span></p>
</div>
<div class="item">
<label for="ukc-input-stepper-unit-b">Seeded rye</label>
<div class="ctl">
<button type="button" aria-label="One tray less of seeded rye"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg></button>
<span class="val"><input id="ukc-input-stepper-unit-b" type="text" inputmode="numeric" value="10" aria-describedby="ukc-input-stepper-unit-bh"><span class="unit">trays</span></span>
<button type="button" aria-label="One tray more of seeded rye" disabled><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg></button>
</div>
<p class="cap" id="ukc-input-stepper-unit-bh"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg><span>10 trays is all the deck oven fits. Ring the bakery for more.</span></p>
</div>
</fieldset>
</div>
.ukc-input-stepper-unit { position: relative; font-family: var(--uk-font-body, system-ui, sans-serif); color: var(--uk-ink); font-size: 15px; line-height: 1.5;
--tint: color-mix(in srgb, var(--uk-accent) 12%, var(--uk-paper));
--tint-strong: color-mix(in srgb, var(--uk-accent) 22%, var(--uk-paper));
--accent-deep: color-mix(in srgb, var(--uk-accent) 72%, black);
--ink-soft: color-mix(in srgb, var(--uk-ink) 8%, var(--uk-paper));
--line-strong: color-mix(in srgb, var(--uk-ink) 32%, var(--uk-paper));
--danger-tint: color-mix(in srgb, var(--uk-danger) 12%, var(--uk-paper));
--high-tint: color-mix(in srgb, var(--uk-highlight) 28%, var(--uk-paper)); }
.ukc-input-stepper-unit *, .ukc-input-stepper-unit *::before, .ukc-input-stepper-unit *::after { box-sizing: border-box; }
.ukc-input-stepper-unit :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-input-stepper-unit :where(ul, ol) { padding: 0; list-style: none; }
.ukc-input-stepper-unit :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-input-stepper-unit :where(a) { color: inherit; }
.ukc-input-stepper-unit svg { flex: none; }
.ukc-input-stepper-unit .q { display: grid; gap: 20px; max-width: 380px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ukc-input-stepper-unit legend { padding: 0; margin-bottom: 14px; font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--uk-muted); }
.ukc-input-stepper-unit .item { display: grid; gap: 4px; justify-items: start; }
.ukc-input-stepper-unit label { font-size: 16px; font-weight: 700; }
.ukc-input-stepper-unit .hint { font-size: 13px; color: var(--uk-muted); }
.ukc-input-stepper-unit .ctl { display: inline-flex; align-items: stretch; max-width: 100%; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: var(--uk-radius-md); background: var(--uk-paper); overflow: hidden; }
.ukc-input-stepper-unit .ctl:focus-within { border-color: var(--uk-ink); }
.ukc-input-stepper-unit .ctl button { width: 46px; height: 44px; display: grid; place-items: center; border: 0; background: var(--uk-surface); color: var(--uk-ink); cursor: pointer; }
.ukc-input-stepper-unit .ctl button:first-child { border-right: 1px solid var(--uk-line); }
.ukc-input-stepper-unit .ctl button:last-child { border-left: 1px solid var(--uk-line); }
.ukc-input-stepper-unit .ctl button:hover { background: var(--ink-soft); }
.ukc-input-stepper-unit .ctl button:focus-visible { outline: 2px solid var(--uk-accent); outline-offset: -4px; }
.ukc-input-stepper-unit .ctl button:disabled { background: repeating-linear-gradient(135deg, var(--ink-soft) 0 4px, transparent 4px 8px); color: var(--uk-muted); cursor: not-allowed; }
.ukc-input-stepper-unit .val { display: flex; align-items: baseline; gap: 6px; padding: 0 16px; align-self: center; }
.ukc-input-stepper-unit .val input { width: 2.4ch; padding: 0; border: 0; background: transparent; text-align: right; font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ukc-input-stepper-unit .val input:focus-visible { outline: 2px solid var(--uk-accent); outline-offset: 3px; border-radius: 2px; }
.ukc-input-stepper-unit .unit { font-size: 13px; color: var(--uk-muted); }
.ukc-input-stepper-unit .sum { display: flex; gap: 14px; margin-top: 4px; font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 13px; }
.ukc-input-stepper-unit .sum span + span { padding-left: 14px; border-left: 1px solid var(--line-strong); font-weight: 700; }
.ukc-input-stepper-unit .cap { display: flex; gap: 7px; margin-top: 6px; padding: 6px 10px 6px 8px; border-left: 3px solid var(--uk-highlight); background: var(--high-tint); font-size: 13px; }
.ukc-input-stepper-unit .cap svg { margin-top: 2px; }
More inputs
All 27Press comma or Enter after each address. Up to 5.
- dispatch@norrlandtimber.se
- ana.ferreira@quaysideimports.pt
- gate3@kestrel
On this shipment