{#
This all might be a little overengineered? Leaving in for now for consistency
with the checkbox component.
#}

{% set attributes %}
  type="radio"
  class="c-radio{% 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 }}>
