{#
/**
 * @file
 * Vartheme BS5 Starter Kit implementation for the radio checkbox form element.
 *
 * @ingroup themeable
 */
#}
{%
set classes = [
  'js-form-item',
  'form-item',
  'js-form-type-' ~ type|clean_class,
  'form-item-' ~ name|clean_class,
  'js-form-item-' ~ name|clean_class,
  title_display not in ['after', 'before'] ? 'form-no-label',
  disabled == 'disabled' ? 'form-disabled',
  errors ? 'form-item--error',
  'form-check',
]
%}
{%
set description_classes = [
  'description',
  'form-text',
  'text-muted',
  description_display == 'invisible' ? 'visually-hidden',
]
%}
<div{{ attributes.addClass(classes) }}>
  {{ children }}

  {{ label }}

  {% if errors %}
    <div class="form-item--error-message">
      {{ errors }}
    </div>
  {% endif %}

  {% if description.content %}
    <small{{ description.attributes.addClass(description_classes) }}>
      {{ description.content }}
    </small>
  {% endif %}
</div>
