Components / Selects and toggles
Quantity stepper
Minus, a number, plus. For quantities and counts, with the limit disabling a side.
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-toggle-stepper">
<div class="st">
<div class="q"><button type="button" aria-label="Fewer"><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><input type="text" inputmode="numeric" value="2" aria-label="Quantity"><button type="button" aria-label="More"><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>
<div class="q round"><button type="button" aria-label="Fewer" 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="M5 12h14"/></svg></button><input type="text" inputmode="numeric" value="1" aria-label="Guests"><button type="button" aria-label="More"><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>
</div>
</div>
.ukc-toggle-stepper { 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-toggle-stepper *, .ukc-toggle-stepper *::before, .ukc-toggle-stepper *::after { box-sizing: border-box; }
.ukc-toggle-stepper :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-toggle-stepper :where(ul, ol) { padding: 0; list-style: none; }
.ukc-toggle-stepper :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-toggle-stepper :where(a) { color: inherit; }
.ukc-toggle-stepper svg { flex: none; }
.ukc-toggle-stepper .st { display: flex; gap: 16px; flex-wrap: wrap; }
.ukc-toggle-stepper .q { display: inline-flex; border: 1px solid var(--uk-line); border-radius: var(--uk-radius-md); overflow: hidden; background: var(--uk-paper); }
.ukc-toggle-stepper .q button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: var(--uk-surface); cursor: pointer; }
.ukc-toggle-stepper .q button:disabled { color: var(--line-strong); cursor: not-allowed; }
.ukc-toggle-stepper .q input { width: 48px; border: 0; border-left: 1px solid var(--uk-line); border-right: 1px solid var(--uk-line); text-align: center; font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 16px; background: transparent; }
.ukc-toggle-stepper .q.round { border-radius: 999px; gap: 4px; padding: 3px; }
.ukc-toggle-stepper .q.round button { width: 34px; height: 34px; border-radius: 999px; }
.ukc-toggle-stepper .q.round input { border: 0; }
More selects and toggles
All 28Trades on this job 3 selected
Label color
Accent
- ThemeAlertsMenuJob 2318