@gfazioli/mantine-spinner
v3.0.3
Published
A Mantine React component with SVG-based loading spinners featuring multiple animation variants, segment shapes, gradient colors, glow effects, progress mode, and compound components.
Maintainers
Readme
Mantine Spinner Component
❤️ If this component has been useful to you or your team, please consider becoming a sponsor
Overview
[!NOTE] Freely inspired by Matt Cannon on CodePen
This component is created on top of the Mantine library.
Mantine Spinner is a feature-rich React component designed to deliver smooth, customizable loading animations within Mantine-based applications. It exposes controls for visual tuning—including overall size, inner radius, segment count, stroke thickness, animation duration, direction, and much more—so you can match your brand and context, from subtle inline loaders to prominent page-level indicators.
Features
- Animation variants —
fade,pulse,grow,trailwith customizable timing - Segment shapes —
line,dot,arcfor different visual styles - Gradient colors — Smooth color interpolation across segments
- Glow effect — SVG gaussian blur filter with adjustable intensity
- Hue rotation — Continuous rainbow color cycling
- Progress mode — Determinate progress indicator (0–100%) with
role="progressbar" - Compound components —
Spinner.Groupfor concentric stacking,Spinner.Overlayfor loading overlays - Accessibility —
role="status",aria-label,prefers-reduced-motionsupport - Children support — Render centered content inside the spinner
- Mantine Styles API — Full
classNames,styles, and CSS variables support
To avoid hydration mismatches in SSR environments, the spinner renders exclusively on the client because its SVG geometry relies on floating‑point math that may differ between server and browser. Styling is provided via package CSS (with an optional @layer mantine-spinner import) to integrate cleanly with modern CSS layering and Mantine’s design system, resulting in a dependable, visually consistent loading experience.
[!note]
→ Demo and Documentation → Youtube Video → More Mantine Components
Installation
npm install @gfazioli/mantine-spinneror
yarn add @gfazioli/mantine-spinnerAfter installation import package styles at the root of your application:
import '@gfazioli/mantine-spinner/styles.css';Usage
import { Spinner } from '@gfazioli/mantine-spinner';
function Demo() {
return <Spinner />;
}More examples
// Trail variant with glow (neon effect)
<Spinner variant="trail" glow={3} color="cyan" minOpacity={0.3} />
// Dot shape with gradient
<Spinner segmentShape="dot" gradient={{ from: 'blue', to: 'cyan' }} />
// Progress indicator with label
<Spinner progress={65} color="teal">
<Text>65%</Text>
</Spinner>
// Concentric group
<Spinner.Group>
<Spinner size={100} color="blue" />
<Spinner size={60} color="cyan" direction="counter-clockwise" />
</Spinner.Group>
// Loading overlay
<Spinner.Overlay visible={isLoading}>
<Card>Content</Card>
</Spinner.Overlay>Sponsor
❤️ If this component has been useful to you or your team, please consider becoming a sponsor
Your support helps me:
- Keep the project actively maintained with timely bug fixes and security updates
- Add new features, improve performance, and refine the developer experience
- Expand test coverage and documentation for smoother adoption
- Ensure long‑term sustainability without relying on ad hoc free time
- Prioritize community requests and roadmap items that matter most
Open source thrives when those who benefit can give back—even a small monthly contribution makes a real difference. Sponsorships help cover maintenance time, infrastructure, and the countless invisible tasks that keep a project healthy.
Your help truly matters.
💚 Become a sponsor today and help me keep this project reliable, up‑to‑date, and growing for everyone.
https://github.com/user-attachments/assets/2401bfe1-e829-4057-a654-7d0a895a9605
