Components / Selects and toggles
Swatch picker
Round swatches from the kit with a ring around the chosen one, and its name below.
Label color
Accent
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-swatch-picker">
<div class="sp">
<p class="l">Label color</p>
<div class="sw" role="radiogroup" aria-label="Label color">
<button type="button" role="radio" aria-checked="true" class="on" style="background: var(--uk-accent)" aria-label="Accent"></button>
<button type="button" role="radio" aria-checked="false" style="background: var(--uk-ink)" aria-label="Ink"></button>
<button type="button" role="radio" aria-checked="false" style="background: var(--uk-highlight)" aria-label="Highlight"></button>
<button type="button" role="radio" aria-checked="false" style="background: var(--uk-danger)" aria-label="Danger"></button>
<button type="button" role="radio" aria-checked="false" style="background: var(--uk-surface)" aria-label="Surface"></button>
</div>
<p class="v">Accent</p>
</div>
</div>
.ukc-toggle-swatch-picker { 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-swatch-picker *, .ukc-toggle-swatch-picker *::before, .ukc-toggle-swatch-picker *::after { box-sizing: border-box; }
.ukc-toggle-swatch-picker :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-toggle-swatch-picker :where(ul, ol) { padding: 0; list-style: none; }
.ukc-toggle-swatch-picker :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-toggle-swatch-picker :where(a) { color: inherit; }
.ukc-toggle-swatch-picker svg { flex: none; }
.ukc-toggle-swatch-picker .sp { display: grid; gap: 10px; }
.ukc-toggle-swatch-picker .l { font-weight: 600; font-size: 14px; }
.ukc-toggle-swatch-picker .sw { display: flex; gap: 10px; }
.ukc-toggle-swatch-picker .sw button { width: 30px; height: 30px; border-radius: 999px; border: 2px solid var(--uk-paper); box-shadow: 0 0 0 1px var(--uk-line); cursor: pointer; }
.ukc-toggle-swatch-picker .sw button.on { box-shadow: 0 0 0 2px var(--uk-ink); }
.ukc-toggle-swatch-picker .v { font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 12px; color: var(--uk-muted); }
More selects and toggles
All 28- ThemeAlertsMenuJob 2318
Assign to
Mara EllisOmar HaddadTomasz Malek3 of 12 people