{#def field, value #}

{% do attrs.set(
  name=field.name,
  value=value,
  checked=field.value == value
) %}
{% if field.error %}
  {% do attrs.set(invalid=field.error.msg) %}
{% endif %}

<ui:Checkbox __attrs={{attrs}} />