Configurator
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Ich möchte den OTTO-Newsletter erhalten.</label></oc-checkbox-v2>Usage
Anatomy
- Checkbox
- Label
HTML
<div class="anatomy" style="display:block;width:max-content;margin:28px auto">
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<span class="anatomy-pin" style="left:-16px;top:50%">1</span>
<span class="anatomy-pin" style="left:calc(100% + 16px);top:50%">2</span>
<ol class="anatomy-key"><li data-n="1">Checkbox</li><li data-n="2">Label</li></ol>Variants
There are two variants of the checkbox. Both come in size50 and size100.
- Default
- Error: The error variant is not only visualized by the error color but also by an error icon, which is due to accessibility.
Default, size 100
Error, size 100
Default, size 50
Error, size 50
HTML
<p class="demo-label">Default, size 100</p>
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Newsletter abonnieren</label></oc-checkbox-v2>
<p class="demo-label">Error, size 100</p>
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">AGB akzeptieren</label><span slot="error">Bitte akzeptiere die AGB.</span></oc-checkbox-v2>
<p class="demo-label">Default, size 50</p>
<oc-checkbox-v2 size="50" width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Newsletter abonnieren</label></oc-checkbox-v2>
<p class="demo-label">Error, size 50</p>
<oc-checkbox-v2 size="50" width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">AGB akzeptieren</label><span slot="error">Bitte akzeptiere die AGB.</span></oc-checkbox-v2>
Behavior
States
Enabled (hover, press, focus it)
Error
Disabled
HTML
<p class="demo-label">Enabled (hover, press, focus it)</p>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<p class="demo-label">Error</p>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label><span slot="error"></span></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Label</label><span slot="error"></span></oc-checkbox-v2>
<p class="demo-label">Disabled</p>
<oc-checkbox-v2><input type="checkbox" disabled aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" checked disabled aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
Interaction
Users can check a checkbox by tapping anywhere on it. The label is also part of the hitbox and ensures proper support in assistive technologies, improving usability and accessibility. To uncheck it, it may be tapped again. There is also a disabled variant of the checkbox that cannot be clicked or tapped.
Indeterminate
An indeterminate state indicates that a checkbox's value is neither fully checked nor unchecked, typically used in nested lists to show that only some sub-items are selected. It serves as a visual "mixed" status, ensuring the parent element accurately reflects the partial selection of its children without implying a checked or default state.
In a nested list, there are three specific states possible: Indeterminate (only some sub-elements are selected), Checked (all sub-elements are selected), and Unchecked (no sub-elements are selected).
When
Fitting
The checkbox is 1.5rem high and 1.5rem wide. The label is set to fit-content by default, but it can be overwritten to fill-parent. Note, that the whole line is interactive in this case.
fit
fill (default)
Long label wraps
HTML
<p class="demo-label">fit</p>
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<p class="demo-label">fill (default)</p>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<p class="demo-label">Long label wraps</p>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Ich möchte über Angebote und Neuheiten per E-Mail informiert werden.</label></oc-checkbox-v2>
Placement
The checkbox has a mandatory label which can be placed left or right with a small gap to the checkbox. Ideally, there should be a 24px gap between checkboxes if they are placed vertically or horizontally.
Label right (default)
Label left
HTML
<p class="demo-label">Label right (default)</p>
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<p class="demo-label">Label left</p>
<oc-checkbox-v2 width-behavior="fit" label-placement="left"><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
Vertical list, 24px gap
HTML
<p class="demo-label">Vertical list, 24px gap</p>
<oc-form-group-v1 orientation="vertical" gap="var(--oc-base-dimension-24)" oc-aria-label="Kategorie">
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Label</label></oc-checkbox-v2>
</oc-form-group-v1>
Checkbox vs. radio button
Use the checkbox when multiple options can be selected (multiple selection) or a standalone option can be checked. When only one option can be selected from a list use radio buttons (single selection).
Checkbox: several choices
Radio button: one choice
HTML
<p class="demo-label">Checkbox: several choices</p>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Damen</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Herren</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Kinder</label></oc-checkbox-v2>
<p class="demo-label">Radio button: one choice</p>
<oc-radio-button-v2><input type="radio" name="cb-vs-rb" aria-label="oc-auto"><label slot="label">Standardversand</label></oc-radio-button-v2>
<oc-radio-button-v2><input type="radio" name="cb-vs-rb" checked aria-label="oc-auto"><label slot="label">Expressversand</label></oc-radio-button-v2>
<oc-radio-button-v2><input type="radio" name="cb-vs-rb" aria-label="oc-auto"><label slot="label">Abholung</label></oc-radio-button-v2>
Checkbox vs. switch
Use the checkbox when a separate interaction is needed to confirm a choice, such as "Speichern" or "Bestätigen", or when multiple options can be selected simultaneously as part of a larger form.
Use the switch for immediate actions, such as toggling a setting on or off. The action happens the moment the user interacts with it.
Checkbox: confirmed with a button
Switch: takes effect at once
HTML
<p class="demo-label">Checkbox: confirmed with a button</p>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Ich möchte den OTTO-Newsletter erhalten.</label></oc-checkbox-v2>
<oc-button-v1 variant="primary">Weiter</oc-button-v1>
<p class="demo-label">Switch: takes effect at once</p>
<oc-switch-v3><input type="checkbox" checked aria-label="oc-auto"><label slot="label">OTTO-Newsletter erhalten</label></oc-switch-v3>
Do not use switches for lists consisting of multiple options. Instead, use checkboxes. Checkboxes imply that the items are related and take up less visual space than switches.
Do
Kategorie
HTML
<p class="demo-title">Kategorie</p>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Fernseher</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">TV-Wandhalterung</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">TV-Wände</label></oc-checkbox-v2>
Don't
Kategorie
HTML
<p class="demo-title">Kategorie</p>
<oc-switch-v3><input type="checkbox" aria-label="oc-auto"><label slot="label">Fernseher</label></oc-switch-v3>
<oc-switch-v3><input type="checkbox" checked aria-label="oc-auto"><label slot="label">TV-Wandhalterung</label></oc-switch-v3>
<oc-switch-v3><input type="checkbox" aria-label="oc-auto"><label slot="label">TV-Wände</label></oc-switch-v3>
Best Practices
Even if they are placed far enough from each other, the associated label for a checkbox may be mixed up with a different one by users.
HTML
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Rot</label></oc-checkbox-v2>
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Blau</label></oc-checkbox-v2>
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Grün</label></oc-checkbox-v2>
This is the only way to ensure consistent behavior and layout.
HTML
<oc-checkbox-v2 width-behavior="fit"><input type="checkbox" aria-label="oc-auto"><label slot="label">Auch der Text ist klickbar</label></oc-checkbox-v2>
Content Guidelines
Accessibility
Related Components
Implementation
Live demo
Newsletter abonnieren
Neuheiten, Trends und Angebote, passend zu dem, was dich interessiert.
Was interessiert dich?
HTML
<div style="max-width:720px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:32px;align-items:center">
<img src="/previews/imagery/samples/otto-colour-field/colour-field-parcel.webp" alt="" style="display:block;width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:12px">
<div style="display:grid;gap:20px">
<div style="display:grid;gap:4px">
<p class="oc-headline-100">Newsletter abonnieren</p>
<p class="oc-copy-100 oc-text-color-secondary">Neuheiten, Trends und Angebote, passend zu dem, was dich interessiert.</p>
<oc-text-field-v1 type="email" autocomplete="email">E-Mail-Adresse</oc-text-field-v1>
<div style="display:grid;gap:12px">
<p class="oc-copy-100"><b>Was interessiert dich?</b></p>
<oc-form-group-v1 orientation="vertical" gap="var(--oc-base-dimension-16)" oc-aria-label="Interessen">
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Mode</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" checked aria-label="oc-auto"><label slot="label">Wohnen</label></oc-checkbox-v2>
<oc-checkbox-v2><input type="checkbox" aria-label="oc-auto"><label slot="label">Technik</label></oc-checkbox-v2>
</oc-form-group-v1>
<oc-divider-v1></oc-divider-v1>
<oc-checkbox-v2 size="50"><input type="checkbox" required aria-label="oc-auto"><label slot="label">Ja, ich möchte den OTTO-Newsletter per E-Mail erhalten.</label><span slot="hint">Du kannst dich jederzeit wieder abmelden.</span></oc-checkbox-v2>
<oc-button-v1 variant="primary">Jetzt anmelden</oc-button-v1>