Core
Switch
oui / non ; pour révéler des champs quand la réponse est oui, voir Conditional Reveal
Options
Ce qui s’ajoute au HTML du composant, à combiner entre elles. Le HTML de chaque cas est dans les exemples dessous.
Éteint, allumé
Le libellé prend la place libre : l’interrupteur est au bout de la ligne.
HTML
<label class="switch">
<span class="switch__text">
<span class="switch__label">Alerte mail lors du téléchargement par les régies</span>
</span>
<input class="switch__control" type="checkbox" role="switch" id="alerte-telechargement" name="alerte_telechargement">
<span class="switch__thumb" aria-hidden="true"></span>
</label>
<label class="switch">
<span class="switch__text">
<span class="switch__label">Export XLS des EPDR avec un onglet par radio</span>
</span>
<input class="switch__control" type="checkbox" role="switch" id="export-xls-par-radio" name="export_xls_par_radio" checked>
<span class="switch__thumb" aria-hidden="true"></span>
</label>
Avec description
Une phrase sous le libellé, qui dit ce que fait l’autre réponse ; reliée à la case par aria-describedby.
HTML
<label class="switch">
<span class="switch__text">
<span class="switch__label">Mêmes régies pour tous les spots</span>
<span class="switch__description" id="regies-identiques-description">Sinon, vous les choisissez spot par spot.</span>
</span>
<input class="switch__control" type="checkbox" role="switch" id="regies-identiques" name="regies_identiques" aria-describedby="regies-identiques-description" checked>
<span class="switch__thumb" aria-hidden="true"></span>
</label>
Désactivé
HTML
<label class="switch switch--disabled">
<span class="switch__text">
<span class="switch__label">Alerte mail lors du téléchargement par les régies</span>
</span>
<input class="switch__control" type="checkbox" role="switch" name="alerte-desactivee" disabled>
<span class="switch__thumb" aria-hidden="true"></span>
</label>
<label class="switch switch--disabled">
<span class="switch__text">
<span class="switch__label">Export XLS des EPDR avec un onglet par radio</span>
</span>
<input class="switch__control" type="checkbox" role="switch" name="export-desactive" checked disabled>
<span class="switch__thumb" aria-hidden="true"></span>
</label>