alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SpinnerTemplates

    Specifies the template options for the Syncfusion.Blazor.Spinner.SfSpinner component. This allows you to define custom content to be displayed within the spinner.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    SpinnerTemplates
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Spinner
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SpinnerTemplates : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    The SpinnerTemplates component is used as a child tag within the Syncfusion.Blazor.Spinner.SfSpinner component to specify a custom layout or content.

    Examples

    In the following example, a custom template is defined for the Syncfusion.Blazor.Spinner.SfSpinner.

    <SfSpinner @bind-Visible="@SpinnerVisible">
      <SpinnerTemplates>
          <Template>
              <div class="custom-spinner-template">
                  <div class="spinner-dot"></div>
                  <span>Loading...</span>
              </div>
          </Template>
      </SpinnerTemplates>
    </SfSpinner>
    
    <style>
    .custom-spinner-template {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }
    .spinner-dot {
       width: 20px;
       height: 20px;
       border-radius: 50%;
       background-color: #007bff;
       animation: bounce 1.4s infinite ease-in-out both;
    }
    @keyframes bounce {
      0%, 80%, 100% { transform: scale(0); }
      40% { transform: scale(1.0); }
    }
    </style>
    
    @code {
        private bool SpinnerVisible { get; set; } = true;
    }

    Constructors

    SpinnerTemplates()

    Declaration
    public SpinnerTemplates()

    Properties

    Template

    Gets or sets the custom content to be displayed within the spinner.

    Declaration
    [Parameter]
    public RenderFragment Template { get; set; }
    Property Value
    Type Description
    RenderFragment

    A RenderFragment that defines the template for the spinner. The default value is null.

    Remarks

    When this property is set, the default spinner animation is replaced with the custom content provided in the template.

    Methods

    Dispose()

    Releases the unmanaged resources used by the SpinnerTemplates component.

    Declaration
    public void Dispose()
    Remarks

    This method is called to dispose of the component and its resources.

    Dispose(bool)

    Releases the unmanaged resources used by the SpinnerTemplates component and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    A bool value that indicates whether the method call comes from a Dispose() method (if true) or from a finalizer (if false).

    Overrides
    OwningComponentBase.Dispose(bool)
    Remarks

    If disposing is true, this method releases all managed resources held by this component.

    OnInitialized()

    A protected method that is invoked when the component is initialized.

    Declaration
    protected override void OnInitialized()
    Overrides
    ComponentBase.OnInitialized()
    Remarks

    This method checks if a Template has been provided and, if so, updates the parent Syncfusion.Blazor.Spinner.SfSpinner component with the new template.

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved