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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-heatmap-calendar-sb

v0.0.3

Published

heatmap calendar component for react native

Downloads

481

Readme

React Native Heatmap Calendar SB

App Screenshot

Demo GIF

React Native calendar heatmap component designed for visualizing daily data trends and patterns with ease. This customizable component provides an intuitive way to represent each day’s data intensity using color gradients, making it ideal for tracking patterns, activity levels, or metrics over time. Whether you’re monitoring engagement levels, productivity, or any recurring events, the calendar offers a visual overview of fluctuations across days of the month.

With configurable colors, border styles, and text options, this component allows you to tailor the heatmap’s appearance to match your app's design and branding. Each day’s color shade represents the relative data level for that day, helping users quickly spot trends, high-activity days, and low periods in the calendar view. This heatmap calendar is perfect for applications that benefit from clear visual insights, enabling users to make data-driven decisions by recognizing patterns at a glance.

Features

  • Displays patterns by day in a month view
  • Customizable color shades for different booking levels
  • Highlights today's date and selected date with custom styles
  • Easy navigation between months

Installation

Install the package via npm:

npm install react-native-heatmap-calendar-sb

Peer Dependencies

This package requires the following dependencies:

"react": ">= 16.x.x",
"react-native": ">= 0.55.x",
"moment": ">= 2.24.0"

Make sure these dependencies are installed in your project.

Usage

Importing the Component

Import the HeatmapCalendar component in your React Native file:

import HeatmapCalendar from 'react-native-heatmap-calendar-sb';

Basic Example

Use the component by passing in required props, such as dailyBookingPercentages for booking data, colors for color shades, and other customizable styling options:

const dailyBookingPercentages = [5, 20, 40, 80, 100, 0, 60, 10, 30, 50, 90, 75, 20, 45, 65, 10, 55, 25, 35, 85, 95, 15, 5, 90, 70, 0, 30, 45, 100, 60];

<HeatmapCalendar
  dailyBookingPercentages={dailyBookingPercentages} // array of percentages per day
  colors={['#e0f7fa', '#b2ebf2', '#80deea', '#4dd0e1', '#26c6da']} // color gradient based on percentages
  todayBackgroundColor="#FFD700" // custom color for today's background
  borderStyle={{ borderColor: '#000', borderWidth: 2 }}
  textColor="#333" // color of dates
  todayTextColor="#fff" // text color for today's date
/>

Props

| Prop | Type | Description | |----------------------|-------------|--------------------------------------------------------------------------------------------------| | dailyBookingPercentages | Array<number> | Array representing percentages for each day of the month. | | colors | Array<string> | Array of colors representing different levels of booking, used for shading. | | todayBackgroundColor | string | Background color for today's date. | | borderStyle | object | Styling for the border around today's date. | | textColor | string | Default color for day text. | | todayTextColor | string | Text color for today's date. |

Example with Custom Colors and Styling

<HeatmapCalendar
  dailyBookingPercentages={[10, 30, 60, 90]}
  colors={['#f0f8ff', '#a2d5f2', '#07689f', '#001f3f']}
  todayBackgroundColor="#FFD700"
  borderStyle={{ borderColor: '#000', borderWidth: 1 }}
  textColor="#333"
  todayTextColor="#fff"
/>

Credits

Inspired by GitHub's commit calendar heatmap and other similar calendar heatmap libraries.

License

This package is available under the MIT license. See the LICENSE file for more information.


Author

Saurabh Bhaskar