{# A single tab of the component. #} {% props paneId, # id of the '.tab-pane' element displayed when this tab is selected label = '', # tab label (pass it already translated; it may contain HTML) active = false, # true when this is the selected tab icon = null, # optional icon displayed before the label errorCount = 0, # number of form validation errors in the fields of this tab badge = null, # optional FormTabBadgeDto displayed after the label %}
  • {%- if icon %}{% endif -%} {# 'data-content' repeats the plain label text: CSS uses it to reserve the width of the semibold label, so tabs don't shift when the selected tab changes #} {{- label|raw -}} {%- if errorCount > 0 -%} {{ errorCount }} {%- endif -%} {%- if badge is not null and badge.hasVisibleContent -%} {%- set badge_attributes = badge.htmlStyle ? badge.htmlAttributes|merge({style: badge.htmlStyle}) : badge.htmlAttributes -%} {{ badge.content }} {%- endif -%}