@namespace BootstrapBlazor.Components
@inherits ButtonBase

<button @attributes="@AdditionalAttributes" type="@ButtonType.ToDescriptionString()" id="@Id" class="@ClassName"
        disabled="@Disabled" role="button" tabindex="@Tab"
        data-bs-placement="@PlacementString" data-bs-trigger="@TriggerString" data-bb-async="@IsAsyncString"
        aria-disabled="@DisabledString"
        @onclick="@OnClickButton" @onclick:stopPropagation="@StopPropagation" @ref="ButtonElement">
    @if(IsAsyncLoading)
    {
        <i class="@LoadingIcon"></i>
    }
    else if (!string.IsNullOrEmpty(Icon))
    {
        <i class="@Icon"></i>
    }
    @if (!string.IsNullOrEmpty(Text))
    {
        <span>@Text</span>
    }
    <CascadingValue Value="this" IsFixed="true">
        @ChildContent
    </CascadingValue>
</button>
