Skip to content

gfazioli/mantine-spinner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

136 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mantine Spinner Component

mantine Spinner

Overview

Note

Freely inspired by Matt Cannon on CodePen

This component is created on top of the Mantine library. It requires Mantine 9.x and React 19.

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 variantsfade, pulse, grow, trail with customizable timing
  • Segment shapesline, dot, arc for 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 componentsSpinner.Group for concentric stacking, Spinner.Overlay for loading overlays
  • Accessibilityrole="status", aria-label, prefers-reduced-motion support
  • 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.

Installation

npm install @gfazioli/mantine-spinner

or

yarn add @gfazioli/mantine-spinner

After 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

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.


spinner-web.mp4

Star History Chart

About

A Mantine React component with SVG-based loading spinners featuring multiple animation variants, segment shapes, gradient colors, glow effects, progress mode, and compound components.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Generated from gfazioli/mantine-marquee