{# Builds a single checkbox input. name - The name of the form parameter. id - The id to use on the input and label. Convention is to prefix with 'field-'. label - The human readable label. value - The value of the input. checked - If true the checkbox will be checked error - An error string for the field or just true to highlight the field. classes - An array of classes to apply to the form-group. is_required - Boolean of whether this input is required for the form to validate Example: {% import 'macros/form.html' as form %} {{ form.checkbox('remember', checked=true) }} #} {% macro checkbox(name, id='', label='', value='', checked=false, placeholder='', error="", classes=[], attrs={}, is_required=false) %} {%- set extra_html = caller() if caller -%} {{ ui.checkbox(extra_html, name=name, id=id, label=label, value=value, checked=checked, errors=error, attrs=attrs, required=is_required) }} {% endmacro %}