{#
/**
 * @file
 * Theme implementation for a form element label.
 *
 * Available variables:
 * - title: The label's text.
 * - title_display: Elements title_display setting.
 * - required: An indicator for whether the associated form element is required.
 * - attributes: A list of HTML attributes for the label.
 *
 * @see template_preprocess_form_element_label()
 */
#}
{% set modifier_classes = [
  required ? 'js-form-required',
]|join(' ')|trim %}

{% if title is not empty or required -%}
  {% include '@components/form-item/_form-item-label.twig' with {
    'attributes': attributes,
    'modifier_classes': modifier_classes,
  } %}
{%- endif %}
