npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@math-curve-loaders/react

v1.0.1

Published

Mathematical curve loading animations as reusable React components

Readme

@math-curve-loaders/react

Mathematical curve loading animations as reusable React components.

A collection of 21 beautifully crafted SVG curve loaders — each one a mathematical curve animated in real time with trailing particles, pulsing detail, and smooth rotation. Drop them into your app as a loading spinner or decorative element.

Installation

npm install @math-curve-loaders/react
# or
yarn add @math-curve-loaders/react
# or
pnpm add @math-curve-loaders/react

Requirements: React 18+.

Quick Start

import { OriginalThinking } from '@math-curve-loaders/react';

function App() {
  return <OriginalThinking style={{ width: 200, height: 200 }} />;
}

The animation is currentColor-driven, so it inherits your text color:

<div className="text-indigo-400">
  <OriginalThinking style={{ width: 160, height: 160 }} />
</div>

Available Curves

| Component | Curve Type | |---|---| | OriginalThinking | Custom Rose Trail (7-petal) | | ThinkingFive | Custom Rose Trail (5-petal) | | ThinkingNine | Custom Rose Trail (9-petal) | | RoseOrbit | r = cos(kθ) | | RoseCurve | r = a·cos(kθ) | | RoseTwo | r = a·cos(2θ) | | RoseThree | r = a·cos(3θ) | | RoseFour | r = a·cos(4θ) | | LissajousDrift | x = sin(at), y = sin(bt) | | LemniscateBloom | Bernoulli Lemniscate | | HypotrochoidLoop | Inner Spirograph | | ThreePetalSpiral | Hypotrochoid (R=3) | | FourPetalSpiral | Hypotrochoid (R=4) | | FivePetalSpiral | Hypotrochoid (R=5) | | SixPetalSpiral | Hypotrochoid (R=6) | | ButterflyPhase | Butterfly Curve | | CardioidGlow | Cardioid | | CardioidHeart | r = a(1 + cos θ) | | HeartWave | f(x) Heart Wave | | SpiralSearch | Archimedean Spiral | | FourierFlow | Fourier Curve |

Props

Every curve component accepts:

interface CurveComponentProps {
  /** Override specific curve parameters */
  config?: Partial<Omit<CurveConfig, 'name' | 'tag' | 'description' | 'point' | 'formula'>>;
  /** Additional CSS class name */
  className?: string;
  /** Inline styles (width, height, etc.) */
  style?: React.CSSProperties;
}

Config Overrides

Fine-tune the animation by passing partial curve config:

<OriginalThinking
  config={{
    particleCount: 120,
    trailSpan: 0.5,
    strokeWidth: 3,
    durationMs: 3000,
    petalCount: 6,
    curveScale: 4,
  }}
  style={{ width: 100, height: 100 }}
/>

Key parameters:

| Parameter | Type | Default | Description | |---|---|---|---| | particleCount | number | curve-specific | Number of trailing dots | | trailSpan | number | ~0.3 | Trail length (0–1) | | strokeWidth | number | ~4.5 | SVG stroke width | | durationMs | number | ~5000 | Animation cycle length (ms) | | rotate | boolean | curve-specific | Whether the curve rotates | | rotationDurationMs | number | ~28000 | Full rotation cycle (ms) | | pulseDurationMs | number | ~4500 | Detail pulse interval (ms) |

Curve-specific parameters (e.g. petalCount, roseK, butterflyTurns) follow each curve's mathematical formula.

Using curves programmatically

The curves array is exported so you can pick, randomize, or animate between them:

import { curves, type CurveConfig } from '@math-curve-loaders/react';

const randomCurve = curves[Math.floor(Math.random() * curves.length)];

// Pass it to any curve component via the `config` override prop
<OriginalThinking
  config={randomCurve}
  style={{ width: 200, height: 200 }}
/>

Each CurveConfig object contains everything the animation needs (particleCount, trailSpan, durationMs, curve-specific parameters, and the point() formula).

Re-exported types

import type { CurveConfig } from '@math-curve-loaders/react';

const myCurve: Omit<CurveConfig, 'point' | 'formula'> = {
  name: 'My Curve',
  tag: 'Custom',
  description: '...',
  particleCount: 64,
  trailSpan: 0.35,
  durationMs: 5000,
  rotationDurationMs: 30000,
  pulseDurationMs: 4000,
  strokeWidth: 4.5,
  rotate: true,
};

All exported members

// 21 individual curve components
export {
  OriginalThinking, ThinkingFive, ThinkingNine,
  RoseOrbit, RoseCurve, RoseTwo, RoseThree, RoseFour,
  LissajousDrift, LemniscateBloom, HypotrochoidLoop,
  ThreePetalSpiral, FourPetalSpiral, FivePetalSpiral, SixPetalSpiral,
  ButterflyPhase, CardioidGlow, CardioidHeart, HeartWave,
  SpiralSearch, FourierFlow,
}

// Configuration type and curves registry
export type { CurveConfig }
export { curves }

License

MIT