syncfusion-aspnetcore-spinner
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()andhideSpinner() - 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 parametersshowSpinner()method and behaviorhideSpinner()method and cleanupsetSpinner()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
| Method | Purpose | Usage |
|---|---|---|
createSpinner(config) |
Initialize spinner for a target | ej.popups.createSpinner({ target: element }) |
showSpinner(target) |
Display the spinner | ej.popups.showSpinner(targetElement) |
hideSpinner(target) |
Hide the spinner | ej.popups.hideSpinner(targetElement) |
setSpinner(config) |
Set spinner type/template | ej.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
- Start with Getting Started - references/getting-started.md
- Choose your spinner type - references/spinner-types.md
- Customize appearance - references/styling-customization.md
- Add custom templates if needed - references/templates.md
- Review available methods - references/configuration-methods.md
For more information on Syncfusion ASP.NET Core components, see the main library guide.
More from syncfusion/aspnetcore-ui-components-skills
syncfusion-aspnetcore-charts
Implements Syncfusion ASP.NET Core Chart (SfChart) for data visualization. Use this when building charts, visualizing time-series or categorical data, or creating dashboards. Covers series configuration (line, bar, pie), axes, tooltips, legends, and customization for ASP.NET Core applications.
11syncfusion-aspnetcore-textbox
Complete guide to implementing the Syncfusion TextBox component in ASP.NET Core applications with tag helpers, validation, floating labels, and adornments for building accessible input forms.
11syncfusion-aspnetcore-list-box
Implement and configure Syncfusion ASP.NET Core ListBox component with selection controls. Use this when building selection interfaces with single/multiple modes, data binding, or advanced features. Covers ListBox implementation, selection state management, appearance customization, and user interaction handling.
10syncfusion-aspnetcore-common
**CONFIGURATION GUIDE** — Assist with Syncfusion ASP.NET Core EJ2 components setup, localization, and version compatibility. Use when: installing Syncfusion packages, configuring globalization/localization, selecting compatible versions.
10syncfusion-aspnetcore-rich-text-editor
Implements the Syncfusion ASP.NET Core Rich Text Editor (ejs-richtexteditor tag helper) supporting HTML (WYSIWYG) and Markdown editing modes. Set editorMode='Markdown' for Markdown; default is HTML. Use this skill for toolbar configuration, image upload, table editing, inline or iframe mode, AI assistant integration, mentions, and form validation with rich text in ASP.NET Core projects.
10syncfusion-aspnetcore-theme
**THEMING & APPEARANCE GUIDE** — Assist with Syncfusion ASP.NET Core EJ2 component theming, customization, size modes, and dynamic theme switching. Use when: applying themes (Bootstrap, Material, Tailwind, Fluent, etc.), customizing theme variables, implementing theme switchers, enabling touch mode, or customizing icons and appearance.
10