{#
This all might be a little overengineered? We're basically recreating all of
the HTML attributes manually. See the radio component for another example.

Leaving in for now since I'm not really interested in another breaking change
so soon after our last one.
#}

{% set attributes %}
  type="checkbox"
  class="c-checkbox{% if class %} {{ class }}{% endif %}"
  {% for attribute_name in [
    'value',
    'id',
    'name',
    'autocomplete'
  ] %}
    {% set attribute_value = attribute(_context, attribute_name) %}
    {% if attribute_value %}{{ attribute_name }}="{{ attribute_value }}"{% endif %}
  {% endfor %}
  {% for attribute_name in [
    'checked',
    'required',
    'disabled'
  ] %}
    {% set attribute_value = attribute(_context, attribute_name) %}
    {% if attribute_value %}{{ attribute_name }}{% endif %}
  {% endfor %}
{% endset %}

<input {{ attributes }}>
