- id:
- figma
Switch
Default
-
-
{% include "@Components/fields/switch-field/switch-field.twig" with {props: { name: "default-switch", value: "enabled", }} %} -
<label class="f-switch u-posr d-inline-flex u-cursor-pointer align-items-center gap-3"> <input class="f-switch__input u-posa" type="checkbox" value="enabled" name=default-switch> <span class="f-switch__visual d-inline-flex u-posr"> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__checkmark u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" d="M12.522 4 14 5.5 7.901 11.51a2.107 2.107 0 0 1-2.972-.005L2 8.664l1.467-1.513 2.94 2.85L12.522 4Z"/></svg> </span> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__cross u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M6.495 8.002 3.203 4.746l1.478-1.5 3.32 3.272 3.317-3.272 1.478 1.5-3.292 3.256 3.292 3.246-1.494 1.507L8 9.489l-3.303 3.266-1.494-1.507 3.292-3.246Z" clip-rule="evenodd"/></svg> </span> </span> <span class="f-error u-fz-sm gap-1 d-none"> <span class="f-error__icon d-flex align-items-center justify-content-center"> <span class="icon d-flex align-items-center justify-content-center --colored --danger --sm"> <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24v112c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zm-32 224a32 32 0 1 1 64 0 32 32 0 1 1-64 0z"/></svg> </span> </span> <span class="f-error__title"></span> </span> </label>
Checked
-
-
{% include "@Components/fields/switch-field/switch-field.twig" with {props: { name: "checked-switch", value: "enabled", checked: true, }} %} -
<label class="f-switch u-posr d-inline-flex u-cursor-pointer align-items-center gap-3"> <input class="f-switch__input u-posa" type="checkbox" value="enabled" checked="checked" name=checked-switch> <span class="f-switch__visual d-inline-flex u-posr"> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__checkmark u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" d="M12.522 4 14 5.5 7.901 11.51a2.107 2.107 0 0 1-2.972-.005L2 8.664l1.467-1.513 2.94 2.85L12.522 4Z"/></svg> </span> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__cross u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M6.495 8.002 3.203 4.746l1.478-1.5 3.32 3.272 3.317-3.272 1.478 1.5-3.292 3.256 3.292 3.246-1.494 1.507L8 9.489l-3.303 3.266-1.494-1.507 3.292-3.246Z" clip-rule="evenodd"/></svg> </span> </span> <span class="f-error u-fz-sm gap-1 d-none"> <span class="f-error__icon d-flex align-items-center justify-content-center"> <span class="icon d-flex align-items-center justify-content-center --colored --danger --sm"> <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24v112c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zm-32 224a32 32 0 1 1 64 0 32 32 0 1 1-64 0z"/></svg> </span> </span> <span class="f-error__title"></span> </span> </label>
Disabled
-
-
{% include "@Components/fields/switch-field/switch-field.twig" with {props: { name: "disabled-switch", value: "enabled", checked: true, disabled: true, }} %} -
<label class="f-switch u-posr d-inline-flex u-cursor-pointer align-items-center gap-3 --disabled"> <input class="f-switch__input u-posa" type="checkbox" value="enabled" checked="checked" disabled name=disabled-switch> <span class="f-switch__visual d-inline-flex u-posr"> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__checkmark u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" d="M12.522 4 14 5.5 7.901 11.51a2.107 2.107 0 0 1-2.972-.005L2 8.664l1.467-1.513 2.94 2.85L12.522 4Z"/></svg> </span> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__cross u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M6.495 8.002 3.203 4.746l1.478-1.5 3.32 3.272 3.317-3.272 1.478 1.5-3.292 3.256 3.292 3.246-1.494 1.507L8 9.489l-3.303 3.266-1.494-1.507 3.292-3.246Z" clip-rule="evenodd"/></svg> </span> </span> <span class="f-error u-fz-sm gap-1 d-none"> <span class="f-error__icon d-flex align-items-center justify-content-center"> <span class="icon d-flex align-items-center justify-content-center --colored --danger --sm"> <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24v112c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zm-32 224a32 32 0 1 1 64 0 32 32 0 1 1-64 0z"/></svg> </span> </span> <span class="f-error__title"></span> </span> </label>
With label
-
-
{% include "@Components/fields/switch-field/switch-field.twig" with {props: { name: "label-switch", value: "enabled", label: "Souhlas s GDPR*", }} %} -
<label class="f-switch u-posr d-inline-flex u-cursor-pointer align-items-center gap-3"> <input class="f-switch__input u-posa" type="checkbox" value="enabled" name=label-switch> <span class="f-switch__label d-inline-flex gap-1 u-fw-700 align-items-center">Souhlas s GDPR*</span> <span class="f-switch__visual d-inline-flex u-posr"> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__checkmark u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" d="M12.522 4 14 5.5 7.901 11.51a2.107 2.107 0 0 1-2.972-.005L2 8.664l1.467-1.513 2.94 2.85L12.522 4Z"/></svg> </span> <span class="icon d-flex align-items-center justify-content-center --colored --white --sm f-switch__icon f-switch__cross u-posa"> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M6.495 8.002 3.203 4.746l1.478-1.5 3.32 3.272 3.317-3.272 1.478 1.5-3.292 3.256 3.292 3.246-1.494 1.507L8 9.489l-3.303 3.266-1.494-1.507 3.292-3.246Z" clip-rule="evenodd"/></svg> </span> </span> <span class="f-error u-fz-sm gap-1 d-none"> <span class="f-error__icon d-flex align-items-center justify-content-center"> <span class="icon d-flex align-items-center justify-content-center --colored --danger --sm"> <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24v112c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zm-32 224a32 32 0 1 1 64 0 32 32 0 1 1-64 0z"/></svg> </span> </span> <span class="f-error__title"></span> </span> </label>