mcpField
S
syncfusion-aspnetcore-spinner

syncfusion-aspnetcore-spinner

github.com/syncfusionDesign & UI051 installsUpdated 2w ago
Repository

About syncfusion-aspnetcore-spinner

A guide for ASP.NET Core developers using Syncfusion Spinner to show loading overlays on target elements and configure their type, templates, and lifecycle.

Key features

  1. 01Show loading overlays on target elements
  2. 02Create, show, and hide spinners
  3. 03Choose a theme-based type
  4. 04Use custom HTML or SVG templates
  5. 05Customize appearance with CSS

Use cases

  1. 01Indicate server data loading
  2. 02Provide feedback during file uploads
  3. 03Mark page sections as processing

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/syncfusion/aspnetcore-ui-components-skills --skill syncfusion-aspnetcore-spinner

After installing, type/syncfusion-aspnetcore-spinnerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
configuration-methods.md
getting-started.md
spinner-types.md
styling-customization.md
templates.md

Details

From the project README

Implementing Syncfusion ASP.NET Core Spinner

When to Use This Skill

Use this skill when your users need to:

  • Display loading indicators during async operations (API calls, file uploads)
  • Show progress feedback to prevent users from thinking the app is frozen
  • Block user interaction on specific page sections
  • Customize spinner appearance with colors, themes, or templates
  • Target specific elements for spinner overlay rendering
  • Manage spinner lifecycle (create, show, hide, destroy)
  • Apply different spinner types (Material, Fabric, Bootstrap themes)

Spinner Overview

The Syncfusion Spinner is a lightweight loading indicator that appears over a target element to indicate ongoing processing. It's essential for providing visual feedback during async operations in web applications.

Key Characteristics:

  • Appears as an overlay on a target element
  • Renders centered within the target
  • Prevents user interaction with target while visible
  • Supports theme-based styling (Material, Fabric, Bootstrap)
  • Can use custom HTML templates for branded indicators
  • Lightweight and performant

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

  • Installation and prerequisite setup
  • Adding Syncfusion stylesheet and script resources
  • Creating your first spinner with createSpinner()
  • Showing and hiding spinners with showSpinner() and hideSpinner()
  • Targeting specific page elements
  • Basic implementation patterns
Types and Configuration

📄 Read: references/spinner-types.md

  • Available spinner types (Material, Fabric, Bootstrap, Bootstrap4, High Contrast)
  • Changing spinner type with setSpinner()
  • Theme-based type selection
  • When to use each type
  • Configuration before component creation
Styling and Customization

📄 Read: references/styling-customization.md

  • CSS customization patterns for each theme
  • Modifying stroke color and appearance
  • Material theme CSS selectors
  • Fabric theme CSS selectors
  • Bootstrap theme CSS selectors
  • Bootstrap4 theme CSS selectors
  • High Contrast theme CSS selectors
  • Using CSS variables and custom styles
Custom Templates

📄 Read: references/templates.md

  • Creating custom spinner templates
  • Using setSpinner() with template configuration
  • Custom HTML and SVG templates
  • When to use custom templates
  • Template scope and initialization order
  • Styling custom templates with CSS
Configuration Methods Reference

📄 Read: references/configuration-methods.md

  • createSpinner() method and parameters
  • showSpinner() method and behavior
  • hideSpinner() method and cleanup
  • setSpinner() method for type and template configuration
  • Target element configuration
  • Method chaining and initialization patterns

Quick Start Example

Minimal Implementation
<!-- HTML -->
<div id="container">
    <p>Content here</p>
    <button id="loadBtn">Start Loading</button>
</div>

<script>
    // Create spinner targeting the container
    var target = document.getElementById('container');
    ej.popups.createSpinner({ target: target });
    
    // Show spinner on button click
    document.getElementById('loadBtn').addEventListener('click', function() {
        ej.popups.showSpinner(target);
        
        // Simulate async work
        setTimeout(function() {
            ej.popups.hideSpinner(target);
        }, 3000);
    });
</script>

Common Patterns

Pattern 1: Form Submission with Spinner

function submitForm() {
    var target = document.getElementById('formContainer');
    ej.popups.createSpinner({ target: target });
    ej.popups.showSpinner(target);
    
    fetch('/api/submit', { method: 'POST', body: formData })
        .then(response => response.json())
        .then(data => {
            ej.popups.hideSpinner(target);
            showSuccessMessage('Form submitted');
        })
        .catch(error => {
            ej.popups.hideSpinner(target);
            showErrorMessage('Submission failed');
        });
}

Pattern 2: Multiple Async Operations

var target = document.getElementById('container');
ej.popups.createSpinner({ target: target });

// Show once, hide when all complete
Promise.all([fetch1(), fetch2(), fetch3()])
    .then(() => {
        ej.popups.showSpinner(target);
        // Process results
        ej.popups.hideSpinner(target);
    });

Pattern 3: Theme-Based Spinner

// Set spinner type before creating other components
ej.popups.setSpinner({ type: 'Bootstrap' });

var target = document.getElementById('container');
ej.popups.createSpinner({ target: target });
ej.popups.showSpinner(target);

Key Methods Reference

MethodPurposeUsage
createSpinner(config)Initialize spinner for a targetej.popups.createSpinner({ target: element })
showSpinner(target)Display the spinnerej.popups.showSpinner(targetElement)
hideSpinner(target)Hide the spinnerej.popups.hideSpinner(targetElement)
setSpinner(config)Set spinner type/templateej.popups.setSpinner({ type: 'Bootstrap' })

Important: setSpinner() must be called BEFORE createSpinner() to take effect.

Common Use Cases

Loading Data from Server

// Show spinner while fetching data
ej.popups.showSpinner(target);

fetch('/api/data')
    .then(r => r.json())
    .then(data => {
        populateUI(data);
        ej.popups.hideSpinner(target);  // Hide when done
    });

File Upload Progress

ej.popups.showSpinner(uploadTarget);

uploadFile(file)
    .then(() => {
        ej.popups.hideSpinner(uploadTarget);
        showMessage('Upload complete');
    });

Grid Data Binding

// Show spinner while grid loads data
ej.popups.showSpinner(gridContainer);

// Grid handles its own loading after initialization
// Hide spinner when grid dataBound event fires
gridInstance.dataBound = function() {
    ej.popups.hideSpinner(gridContainer);
};

Next Steps

  1. Start with Getting Started - references/getting-started.md
  2. Choose your spinner type - references/spinner-types.md
  3. Customize appearance - references/styling-customization.md
  4. Add custom templates if needed - references/templates.md
  5. Review available methods - references/configuration-methods.md

For more information on Syncfusion ASP.NET Core components, see the main library guide.

Comments

Markdown supported