# react-monthly-heatmap

> A react based component for monthly heatmap

Latest version **1.0.4** (published 2021-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-monthly-heatmap
pnpm add react-monthly-heatmap
yarn add react-monthly-heatmap
bun add react-monthly-heatmap
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-02-24 |
| First published | 2019-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 56.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Sujan Joshi |
| Maintainers | skjo0c |

## Links

- npm: https://www.npmjs.com/package/react-monthly-heatmap
- Repository: https://github.com/skjo0c/react-monthly-heatmap
- Homepage: https://github.com/skjo0c/react-monthly-heatmap#readme
- Issues: https://github.com/skjo0c/react-monthly-heatmap/issues
- npm.io page: https://npm.io/package/react-monthly-heatmap

## Dependencies (2)

- [date-fns](https://npm.io/package/date-fns.md) ^2.17.0
- [@babel/plugin-proposal-class-properties](https://npm.io/package/@babel/plugin-proposal-class-properties.md) ^7.13.0

## Recent versions

- 1.0.4 (latest) — 2021-02-24
- 1.0.3 — 2019-04-08
- 1.0.2 — 2019-04-08
- 1.0.1 — 2019-04-07

## README

# react-monthly-heatmap

A calendar heatmap component built with date-fns, inspired by github's [repo](https://github.com/patientslikeme/react-calendar-heatmap). The component expands to size of container and is super configurable. Try it out on [CodeSandbox](https://codesandbox.io/s/r49xv17zzm).

Based on following tutorials:

[Publish Your Own React Component as Npm Package Under 5 Minutes](https://medium.com/quick-code/publish-your-own-react-component-as-npm-package-under-5-minutes-8a47f0cb92b9)

[Create a custom calendar in React](https://blog.flowandform.agency/create-a-custom-calendar-in-react-3df1bfd0b728)

## Setup

Install the npm module with npm:

```
npm i react-monthly-heatmap
```

## Usage

Import the component:

```
import HeatMapCalendar from 'react-monthly-heatmap';
```

To use the component, simply use like following:

```
<HeatMapCalendar
  values={[
    { date: '2019-03-31', count: 1, color: '#8cc665' },
    { date: '2019-04-01', count: 2, color: '#44a340' },
    { date: '2019-04-06', count: 3, color: '#1e6823' },
  ]}
/>
```

## Props

| Name      | Type                          | Description                                                                                                                                      |
| --------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `values`  | **Required**, Array of Object | Required array of objects which each have a date property, count and color code. Example: `[{ date: '2019-03-31', count: 1, color: '#8cc665' }]` |
| `onClick` | Function                      | Callback to invoke when a square is clicked, e.g. `(value) => alert(value)`                                                                      |
| `toolTip` | Function                      | Callback to invoke when mouse pointer is over a date                                                                                             |

---
_Source: https://npm.io/package/react-monthly-heatmap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
