Printio/templates/macros/switches.html
2025-10-27 22:24:25 -07:00

12 lines
532 B
HTML

{# Jinja macro for a slide switch component #}
{% macro switch(id='switch', label='Toggle', checked=false, small=false) -%}
<label class="switch" for="{{ id }}">
<span class="switch-label">{{ label }}</span>
<span class="switch-toggle{{ ' small' if small else '' }}" aria-hidden="false">
<input id="{{ id }}" type="checkbox" {{ 'checked' if checked else '' }} />
<span class="slider" aria-hidden="true"></span>
</span>
<span class="visually-hidden">Toggle {{ label }}</span>
</label>
{%- endmacro %}