{{#let
  (arg-or-default @type "button")
  (arg-or-default @showLabel true)
  (arg-or-default @id (unique-id))
  (unique-id) as |hasLabelBlock type showLabel switchId labelId|
}}
  {{#let (class-names (if @compressed "euiSwitch--compressed") "euiSwitch") as |classes|}}
    <div class={{classes}}>
      <button
        type={{type}}
        id={{switchId}}
        aria-checked={{if @checked "true" "false"}}
        class="euiSwitch__button"
        role="switch"
        aria-label={{if showLabel undefined @label}}
        aria-labelledby={{if showLabel labelId undefined}}
        disabled={{@disabled}}
        ...attributes
        {{on "click" this.onClick}}
      >
        <span class="euiSwitch__body">
          <span class="euiSwitch__thumb"></span>
          <span class="euiSwitch__track">
            {{#unless @compressed}}
              <EuiIcon @type="cross" @size="m" class="euiSwitch__icon" />
              <EuiIcon @type="check" @size="m" class="euiSwitch__icon euiSwitch__icon--checked" />
            {{/unless}}
          </span>
        </span>
      </button>
      {{#if showLabel}}
        {{! template-lint-disable}}
        <span class="euiSwitch__label" id={{labelId}} {{on "click" this.onClick}}>
          {{#if (has-block "label")}}
            {{yield to="label"}}
          {{else}}
            {{@label}}
          {{/if}}
        </span>
        {{! template-lint-enable}}
      {{/if}}
    </div>
  {{/let}}
{{/let}}