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

react-macro-rings

v1.0.2

Published

Animated circular progress rings for React — MacroRing, CalorieRing, MacroRingGroup. Zero dependencies.

Readme

react-macro-rings

npm MIT License GitHub Zero Dependencies React

Animated SVG circular progress rings for React — built for nutrition trackers, fitness dashboards, and health apps.

3 components. Zero dependencies. Pure SVG + inline styles.


When to use this

Use react-macro-rings when:

  • You're building a nutrition tracker, calorie counter, or macro dashboard and need animated ring progress indicators
  • You want pure SVG rings with no canvas, no chart library, no stylesheet to import
  • You need rings that work in dark-mode apps out of the box (track color is transparent by default)
  • You want to display protein / carbs / fat / calorie progress with a single component

Not the right fit if you need full chart types (bar, line, pie) — use Recharts or Victory for that. These rings are purpose-built for circular progress display.


Why not react-circular-progressbar?

react-circular-progressbar renders a single ring with a label. react-macro-rings ships three purpose-built components for nutrition UIs: a macro ring group that renders multiple rings from a data array, a calorie ring with built-in overflow color and a progress bar, and a single configurable ring for anything else. No CSS file to import, no stylesheet conflicts.


Components

| Component | What it does | |-----------|-------------| | <MacroRing> | Single animated ring — protein, carbs, fat, steps, anything | | <MacroRingGroup> | Row of rings from a data array | | <CalorieRing> | Hero ring with label, remaining count, and progress bar |


Install

npm install react-macro-rings

Usage

<MacroRing>

import { MacroRing } from 'react-macro-rings'

<MacroRing
  value={42}
  goal={160}
  color="#F0B429"
  label="Protein"
  unit="g"
/>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | number | 0 | Current value | | goal | number | 100 | Target value | | color | string | '#52B788' | Ring color | | label | string | '' | Label below ring | | unit | string | '' | Unit suffix (g, kcal, %) | | size | number | 64 | Diameter in px | | strokeWidth | number | 6 | Ring thickness | | trackColor | string | 'rgba(255,255,255,0.08)' | Background track color | | showPercent | boolean | true | Show % in center | | showLabel | boolean | true | Show label + value below | | animate | boolean | true | Animate on mount | | style | object | {} | Wrapper style override |


<MacroRingGroup>

import { MacroRingGroup } from 'react-macro-rings'

<MacroRingGroup
  rings={[
    { value: 42,  goal: 160, color: '#F0B429', label: 'Protein', unit: 'g' },
    { value: 180, goal: 200, color: '#60a0ff', label: 'Carbs',   unit: 'g' },
    { value: 30,  goal: 65,  color: '#f06060', label: 'Fat',     unit: 'g' },
  ]}
  size={64}
  gap="24px"
/>

Props

| Prop | Type | Default | |------|------|---------| | rings | array | [] — array of MacroRing prop objects | | size | number | 64 | | strokeWidth | number | 6 | | gap | string | '24px' | | justify | string | 'space-around' | | style | object | {} |


<CalorieRing>

import { CalorieRing } from 'react-macro-rings'

<CalorieRing
  value={850}
  goal={2100}
  color="#52B788"
  overColor="#F0B429"
  showBar={true}
/>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | number | 0 | Current calories | | goal | number | 2000 | Calorie goal | | color | string | '#52B788' | Normal ring color | | overColor | string | '#F0B429' | Color when over goal | | trackColor | string | 'rgba(255,255,255,0.08)' | Track color | | size | number | 80 | Ring diameter in px | | strokeWidth | number | 7 | Ring thickness | | showBar | boolean | true | Show progress bar below | | animate | boolean | true | Animate on mount | | style | object | {} | Wrapper style override |


Full Dashboard Example

import { CalorieRing, MacroRingGroup } from 'react-macro-rings'

export default function Dashboard({ totals, goals }) {
  return (
    <div style={{ background: '#0f1a0f', borderRadius: 24, padding: 20 }}>
      <CalorieRing
        value={totals.cal}
        goal={goals.cal}
        color="#52B788"
        overColor="#F0B429"
      />

      <MacroRingGroup
        rings={[
          { value: totals.protein, goal: goals.protein, color: '#F0B429', label: 'Protein', unit: 'g' },
          { value: totals.carbs,   goal: goals.carbs,   color: '#60a0ff', label: 'Carbs',   unit: 'g' },
          { value: totals.fat,     goal: goals.fat,     color: '#f06060', label: 'Fat',     unit: 'g' },
        ]}
        style={{ marginTop: 20 }}
      />
    </div>
  )
}

Used in Production

Built from the real implementation powering Sage — an AI nutrition coach by Rewrite Labs.


Author

M. Adhitya — Founder, Rewrite Labs

License

MIT © 2025 M. Adhitya