Components / Selects and toggles
Icon swap toggles
A checkbox that trades one icon for another with a quick turn: light and dark, alerts on and off, menu and close, and a word that flips.
Theme
Alerts
Menu
Job 2318
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-daisyui-swap">
<div class="row">
<div class="it"><label class="swap rot"><input type="checkbox" checked aria-label="Dark mode"><span class="on"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z"/></svg></span><span class="off"><svg width="20" height="20" 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="4"/><path d="M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"/></svg></span></label><span class="cap">Theme</span></div>
<div class="it"><label class="swap rot"><input type="checkbox" aria-label="Mute alerts"><span class="on"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20.5h4M3.5 3.5l17 17"/></svg></span><span class="off"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20.5h4"/></svg></span></label><span class="cap">Alerts</span></div>
<div class="it"><label class="swap rot"><input type="checkbox" checked aria-label="Open menu"><span class="on"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg></span><span class="off"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16"/></svg></span></label><span class="cap">Menu</span></div>
<div class="it"><label class="swap flip txt"><input type="checkbox" checked aria-label="Follow job 2318"><span class="on">Following</span><span class="off">Follow</span></label><span class="cap">Job 2318</span></div>
</div>
</div>
.ukc-toggle-daisyui-swap { 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-daisyui-swap *, .ukc-toggle-daisyui-swap *::before, .ukc-toggle-daisyui-swap *::after { box-sizing: border-box; }
.ukc-toggle-daisyui-swap :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-toggle-daisyui-swap :where(ul, ol) { padding: 0; list-style: none; }
.ukc-toggle-daisyui-swap :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-toggle-daisyui-swap :where(a) { color: inherit; }
.ukc-toggle-daisyui-swap svg { flex: none; }
.ukc-toggle-daisyui-swap .row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.ukc-toggle-daisyui-swap .it { display: grid; justify-items: center; gap: 8px; }
.ukc-toggle-daisyui-swap .cap { font-family: var(--uk-font-mono, ui-monospace, monospace); font-size: 11px; color: var(--uk-muted); }
.ukc-toggle-daisyui-swap .swap { position: relative; display: inline-grid; place-content: center; min-width: 44px; height: 44px; border: var(--uk-border-width) solid var(--uk-line); border-radius: var(--uk-radius-md); background: var(--uk-surface); color: var(--uk-ink); cursor: pointer; user-select: none; }
.ukc-toggle-daisyui-swap .swap:has(input:checked) { border-color: var(--line-strong); }
.ukc-toggle-daisyui-swap .swap:has(input:focus-visible) { outline: 2px solid var(--uk-accent); outline-offset: 2px; }
.ukc-toggle-daisyui-swap .swap input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; appearance: none; }
.ukc-toggle-daisyui-swap .swap > span { grid-area: 1 / 1; display: grid; place-items: center; transition: transform var(--uk-motion-duration) var(--uk-motion-ease), opacity var(--uk-motion-duration) var(--uk-motion-ease); }
.ukc-toggle-daisyui-swap .swap .on, .ukc-toggle-daisyui-swap .swap input:checked ~ .off { opacity: 0; }
.ukc-toggle-daisyui-swap .swap input:checked ~ .on { opacity: 1; }
.ukc-toggle-daisyui-swap .rot .on { transform: rotate(-45deg); }
.ukc-toggle-daisyui-swap .rot input:checked ~ .on { transform: rotate(0deg); }
.ukc-toggle-daisyui-swap .rot input:checked ~ .off { transform: rotate(45deg); }
.ukc-toggle-daisyui-swap .txt { padding: 0 14px; font-size: 14px; font-weight: 600; perspective: 20rem; transform-style: preserve-3d; }
.ukc-toggle-daisyui-swap .flip > span { backface-visibility: hidden; }
.ukc-toggle-daisyui-swap .flip .on { transform: rotateY(-180deg); }
.ukc-toggle-daisyui-swap .flip input:checked ~ .on { transform: rotateY(0deg); }
.ukc-toggle-daisyui-swap .flip input:checked ~ .off { transform: rotateY(180deg); }
.ukc-toggle-daisyui-swap .flip:has(input:checked) { background: var(--tint); }
@media (prefers-reduced-motion: reduce) { .ukc-toggle-daisyui-swap .swap > span { transition: none; } }
More selects and toggles
All 28Assign to
Mara EllisOmar HaddadTomasz Malek3 of 12 people
Skerry Line · crossing of 14 June
Live room BMics are hot. Knock and wait.Mics are muted. Come on in.