Checkbox
A boolean checkbox. Supports an indeterminate state, a description (ts checkbox-description), card mode (is-card), an error (is-invalid), and grouping with ts checkbox-group, which includes “select all” (data-ts-select-all).
Forms · TaishoDS Core, in plain HTML.
Examples
One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.
Checked
<label for="ts-checkbox-s1" class="ts checkbox size-md variant-primary is-checked"
><input type="checkbox" id="ts-checkbox-s1" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Get updates</span></label
>Unchecked
<label for="ts-checkbox-s2" class="ts checkbox size-md variant-primary"
><input type="checkbox" id="ts-checkbox-s2" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Accept the terms</span></label
>“Select all” with partial selection
<label for="ts-checkbox-s3" class="ts checkbox size-md variant-primary is-indeterminate"
><input type="checkbox" id="ts-checkbox-s3" indeterminate="" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Select all projects</span></label
>Disabled
<label for="ts-checkbox-s4" class="ts checkbox size-md variant-primary is-disabled"
><input type="checkbox" id="ts-checkbox-s4" disabled="" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Publish to Production</span></label
>With description
<label for="ts-checkbox-s5" class="ts checkbox size-md variant-primary has-description"
><input type="checkbox" id="ts-checkbox-s5" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-body"
><span class="ts checkbox-label">Dashboard</span>
<span class="ts checkbox-description">Read access to the project.</span></span
></label
>Environment cards: checked
<label
for="ts-checkbox-s6"
class="ts checkbox size-md variant-primary is-checked is-card has-description"
><input type="checkbox" id="ts-checkbox-s6" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-body"
><span class="ts checkbox-label">Production</span>
<span class="ts checkbox-description">The whole team sees it.</span></span
></label
>Environment cards: unchecked
<label for="ts-checkbox-s7" class="ts checkbox size-md variant-primary is-card has-description"
><input type="checkbox" id="ts-checkbox-s7" class="ts checkbox-input" />
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-body"
><span class="ts checkbox-label">Staging</span>
<span class="ts checkbox-description">Testing before publishing.</span></span
></label
>With error
<div class="ts checkbox-wrapper">
<label for="ts-checkbox-s8" class="ts checkbox size-md variant-danger is-invalid"
><input
type="checkbox"
id="ts-checkbox-s8"
aria-invalid="true"
aria-describedby="ts-checkbox-s8-hint"
class="ts checkbox-input"
/>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Approve the deployment</span></label
>
<div class="ts input-footer">
<div id="ts-checkbox-s8-hint" class="ts input-hint variant-danger" aria-live="polite">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14"
>
<circle cx="12" cy="12" r="10" />
<line x1="12" x2="12" y1="8" y2="12" />
<line x1="12" x2="12.01" y1="16" y2="16" />
</svg>
<span>Approve the deployment to continue.</span>
</div>
</div>
</div>With hint
<div class="ts checkbox-wrapper">
<label for="ts-checkbox-s9" class="ts checkbox size-md variant-primary"
><input
type="checkbox"
id="ts-checkbox-s9"
aria-describedby="ts-checkbox-s9-hint"
class="ts checkbox-input"
/>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Get release updates</span></label
>
<div class="ts input-footer">
<div id="ts-checkbox-s9-hint" class="ts input-hint variant-default">
<span>Once a month, no spam.</span>
</div>
</div>
</div>Notification group with error
<div
role="group"
aria-label="Notifications"
aria-describedby="ts-checkbox-group-s10-hint"
class="ts checkbox-group"
>
<span class="ts checkbox-group-label">Notifications</span>
<div class="ts checkbox-group-items orientation-vertical">
<label for="ts-checkbox-s11" class="ts checkbox size-md variant-danger is-checked is-invalid"
><input
type="checkbox"
id="ts-checkbox-s11"
checked=""
value="email"
aria-invalid="true"
class="ts checkbox-input"
/>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Email</span></label
><label for="ts-checkbox-s12" class="ts checkbox size-md variant-danger is-invalid"
><input
type="checkbox"
id="ts-checkbox-s12"
value="slack"
aria-invalid="true"
class="ts checkbox-input"
/>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">Slack</span></label
><label for="ts-checkbox-s13" class="ts checkbox size-md variant-danger is-invalid"
><input
type="checkbox"
id="ts-checkbox-s13"
value="sms"
aria-invalid="true"
class="ts checkbox-input"
/>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
<span class="ts checkbox-label">SMS</span></label
>
</div>
<div class="ts input-footer">
<div id="ts-checkbox-group-s10-hint" class="ts input-hint variant-danger" aria-live="polite">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14"
>
<circle cx="12" cy="12" r="10" />
<line x1="12" x2="12" y1="8" y2="12" />
<line x1="12" x2="12.01" y1="16" y2="16" />
</svg>
<span>Choose at least one channel.</span>
</div>
</div>
</div>Class reference
Every value of each modifier, with its HTML ready to copy.
Size
Checkbox size: sm, md, or lg.
<label for="ts-checkbox-v-s1" class="ts checkbox size-sm variant-primary is-checked">
<input type="checkbox" id="ts-checkbox-v-s1" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Production</span>
</label>
<label for="ts-checkbox-v-s2" class="ts checkbox size-md variant-primary is-checked">
<input type="checkbox" id="ts-checkbox-v-s2" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Production</span>
</label>
<label for="ts-checkbox-v-s3" class="ts checkbox size-lg variant-primary is-checked">
<input type="checkbox" id="ts-checkbox-v-s3" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Production</span>
</label>Variant
The color when checked. primary by default, which takes the theme primary (primary; the brand if you don’t set one), or a status color (success, danger…).
<label for="ts-checkbox-v-s4" class="ts checkbox size-md variant-primary is-checked">
<input type="checkbox" id="ts-checkbox-v-s4" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s5" class="ts checkbox size-md variant-success is-checked">
<input type="checkbox" id="ts-checkbox-v-s5" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s6" class="ts checkbox size-md variant-warning is-checked">
<input type="checkbox" id="ts-checkbox-v-s6" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s7" class="ts checkbox size-md variant-info is-checked">
<input type="checkbox" id="ts-checkbox-v-s7" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s8" class="ts checkbox size-md variant-danger is-checked">
<input type="checkbox" id="ts-checkbox-v-s8" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s9" class="ts checkbox size-md variant-brand is-checked">
<input type="checkbox" id="ts-checkbox-v-s9" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s10" class="ts checkbox size-md variant-brand-secondary is-checked">
<input type="checkbox" id="ts-checkbox-v-s10" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>
<label for="ts-checkbox-v-s11" class="ts checkbox size-md variant-accent is-checked">
<input type="checkbox" id="ts-checkbox-v-s11" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Staging</span>
</label>Density
The spacing around the checkbox and its label.
<label
for="ts-checkbox-v-s12"
class="ts checkbox size-md variant-primary is-checked density-compact"
>
<input type="checkbox" id="ts-checkbox-v-s12" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Production</span>
</label>
<label
for="ts-checkbox-v-s13"
class="ts checkbox size-md variant-primary is-checked density-comfortable"
>
<input type="checkbox" id="ts-checkbox-v-s13" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Production</span>
</label>States
The checkbox states: is-checked, is-indeterminate, and is-disabled.
<label for="ts-checkbox-v-s14" class="ts checkbox size-md variant-primary is-checked">
<input type="checkbox" id="ts-checkbox-v-s14" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Ready</span>
</label>
<label for="ts-checkbox-v-s15" class="ts checkbox size-md variant-primary is-indeterminate">
<input type="checkbox" id="ts-checkbox-v-s15" indeterminate="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Queued</span>
</label>
<label for="ts-checkbox-v-s16" class="ts checkbox size-md variant-primary is-disabled">
<input type="checkbox" id="ts-checkbox-v-s16" disabled="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Canceled</span>
</label>Combinations
Size and color combined.
<label for="ts-checkbox-v-s17" class="ts checkbox size-lg variant-brand is-checked">
<input type="checkbox" id="ts-checkbox-v-s17" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Mobile app</span>
</label>
<label for="ts-checkbox-v-s18" class="ts checkbox size-sm variant-danger is-checked">
<input type="checkbox" id="ts-checkbox-v-s18" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Mobile app</span>
</label>
<label for="ts-checkbox-v-s19" class="ts checkbox size-md variant-accent is-checked">
<input type="checkbox" id="ts-checkbox-v-s19" checked="" class="ts checkbox-input" />
<span class="ts checkbox-box">
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="12"
height="12"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-12 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" />
</svg>
</span>
<span class="ts checkbox-label">Mobile app</span>
</label>When to use
- A yes/no option that’s confirmed when the form is submitted (terms, a flag).
- Choosing several items from a list, inside a
ts checkbox-group. - You need the indeterminate state (a partial “select all”).
- You need to show an error or hint right next to the checkbox, on its own or inside the
fieldmarkup.
When not to use
- The change applies immediately, not on submit →
toggle. - It’s choosing one of several →
radio.
Do
- Write a clear, positive label, so checking it means what it says.
- Group several related checkboxes with
ts checkbox-group. - If the label alone isn’t enough to decide, add a description (
has-description). Theis-cardmode works when each option is a card (a plan, a channel). - A group error (
Choose at least one channel.) goes once on the group, not repeated on every checkbox.
Don’t
- Don’t use it for a setting that takes effect immediately →
toggle. - Don’t build a group where only one can be checked →
radio. - Don’t use
is-cardfor a standalone accept-the-terms checkbox. Cards are for choosing between options.
TaishoDS Core
Needs Core’s JS, which hooks in through data-ts-* attributes.
It’s a native <input type="checkbox">. The browser handles focus, keyboard, and form submission. To paint the state, Core mirrors checked to the label’s is-checked class. The error, hint, and description are markup the example already includes.
What it does: A group (ts checkbox-group) with a “select all” checkbox (data-ts-select-all on the parent checkbox). It checks or unchecks all the others, and turns mixed (indeterminate) when only some are checked.
From the CDN, without a build, load taisho.checkbox.css along with taisho.base.css. Also load:
taisho.icon.css
For how Core works in general, see Behavior.
Accessibility
Implements the Checkbox pattern from the WAI-ARIA APG.
- It’s built on a native
<input type="checkbox">(focus, keyboard, and accessible states out of the box). - The mixed (indeterminate) state is reflected in the
<input>'s real DOM property, not just visually. - A checkbox group goes in a
role="group"container with an accessible name (aria-label, oraria-labelledbypointing to the group’s visible text). - The hint text and the error message are linked to the
<input>througharia-describedby. The invalid state setsaria-invalid="true", and the error is announced (aria-live="polite"). In a group, each checkbox carries the invalid state (role="group"doesn’t supportaria-invalid), and the message describes the group. - The checkbox’s description stays inside the
<label>, so it’s part of its accessible name.
Verification
What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.
- axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
- keyboard Adds no keys of its own—it uses the browser’s native behavior.
- screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.