Dense Toggle
Tight gaps and mono type
Preview
HTML
<label>
<input type="checkbox" checked />
Live
</label>
CSS
:root {
--ink: #e7eaf1;
--paper: #141820;
--accent: #7aa2ff;
--accent-2: #9b8cff;
--on-accent: #10131a;
--muted: #8b93a7;
--line: #2c3342;
--chip: #1d2330;
}
label {
display: inline-flex;
align-items: center;
gap: 0.55rem;
color: var(--ink);
font-family: ui-monospace, monospace;
font-size: 0.78rem;
font-weight: 700;
}
input {
appearance: none;
width: 2.4rem;
height: 1.3rem;
margin: 0;
border-radius: 999px;
background: var(--line);
}
input::before {
content: "";
display: block;
width: 1rem;
height: 1rem;
margin: 0.15rem;
border-radius: 50%;
background: var(--paper);
}
input:checked {
background: var(--accent);
}
input:checked::before {
transform: translateX(1.05rem);
}
Tailwind
<style>
:root {
--ink: #e7eaf1;
--paper: #141820;
--accent: #7aa2ff;
--accent-2: #9b8cff;
--on-accent: #10131a;
--muted: #8b93a7;
--line: #2c3342;
--chip: #1d2330;
}
input {
appearance: none;
}
input::before {
content: "";
display: block;
width: 1rem;
height: 1rem;
margin: 0.15rem;
border-radius: 50%;
background: var(--paper);
}
input:checked {
background: var(--accent);
}
input:checked::before {
transform: translateX(1.05rem);
}
</style>
<label class="inline-flex items-center gap-[0.55rem] text-[var(--ink)] font-[ui-monospace,_monospace] text-[0.78rem] font-bold">
<input class="w-[2.4rem] h-[1.3rem] m-0 rounded-full bg-[var(--line)]" type="checkbox" checked />
Live
</label>