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-native-activity-heatmap

v0.2.0

Published

React native component for a simple & customizable LeetCode-style activity heatmap.

Readme

React Native Activity Heatmap

A simple and customizable LeetCode-style activity heatmap component for React Native.

Inspired by react-activity-heatmap for React web.

Installation

The package can be installed via npm:

npm install react-native-activity-heatmap

Or via yarn:

yarn add react-native-activity-heatmap

Usage

This package provides a simple and reusable React Native component to visualize activity data over time in a calendar-style heatmap. It allows you to display daily activity intensity using colored squares, similar to LeetCode's contribution graph. You can easily customize the start and end dates, color scales, and activity data, making it suitable for dashboards, habit trackers, or any app that needs a compact overview of activity trends.

import React from "react";
import { View, Text } from "react-native";
import { ActivityHeatmap } from "react-native-activity-heatmap";

const activities = [
  { date: "2025-08-01", count: 5, level: 2 },
  { date: "2025-08-02", count: 2, level: 1 },
  { date: "2025-08-03", count: 8, level: 3 },
  // add more activity objects here
];

const startDate = new Date("2025-08-01");
const endDate = new Date("2025-08-31");

const App = () => {
  return (
    <View>
      <Text>My Activity Heatmap</Text>
      <ActivityHeatmap 
        activities={activities} 
        startDate={startDate} 
        endDate={endDate} 
      />
    </View>
  );
};

export default App;

Props

| Prop | Type | Required | Description | | --------------- | -------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | activities | Array<HeatmapActivity> | ✅ | Array of activity objects. level controls color intensity, and count is the number of activities displayed in the tooltip. | | startDate | Date | ❌ | The first date in the heatmap. If not specified, it defaults to today's date - 365 days. | | endDate | Date | ❌ | The last date in the heatmap. If not specified, it defaults to today's date. | | cellColors | CellColors | ❌ | Customization for the cell colors. Level 0 is the no activities color and the others are for each level of activity. If not specified, it uses the default green colors. | | renderTooltip | (cell: HeatmapCell) => React.ReactNode | ❌ | Custom function to render a tooltip for a given cell. | | style | ViewStyle | ❌ | Style for the heatmap container. | | monthLabelStyle | object | ❌ | Style for the month labels displayed above the heatmap. | | tooltipStyle | object | ❌ | Style for the tooltip element. | | cellSize | number | ❌ | Size of each cell in pixels. Defaults to 12. |

Types

export type HeatmapActivity = {
  date: string;
  count: number;
  level: number;
};

export type HeatmapCell = HeatmapActivity | "invisible";

export type CellColors = {
  level0: string;
  level1: string;
  level2: string;
  level3: string;
  level4: string;
};

Customization

You can customize the colors to match your app's theme:

const customColors = {
  level0: '#161b22',
  level1: '#0e4429',
  level2: '#006d32',
  level3: '#26a641',
  level4: '#39d353',
};

<ActivityHeatmap 
  activities={activities} 
  cellColors={customColors}
  cellSize={10}
/>

Compatibility

This package supports React Native projects using:

  • React Native: >=0.70.0
  • React: >=18.0.0

Contributing

License

This project is licensed under the MIT License.


Made with create-react-native-library