Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 891 Bytes

File metadata and controls

46 lines (35 loc) · 891 Bytes

MSpinner

MSpinner renders the standard MComponents loading indicator.

Simple

<MSpinner />

Advanced

Show it conditionally around an asynchronous operation:

<button type="button" @onclick="Refresh" disabled="@isLoading">Refresh</button>

@if (isLoading)
{
    <div class="loading-state">
        <MSpinner />
        <span>Loading data…</span>
    </div>
}

@code {
    private bool isLoading;

    private async Task Refresh()
    {
        isLoading = true;
        try
        {
            await LoadData();
        }
        finally
        {
            isLoading = false;
        }
    }
}

MSpinner has no parameters. Style .m-spinner or a containing element when a different size or layout is needed.

View the runnable examples