Skip to content
프로젝트

grubersjoe/react-activity-calendar

GitHub에서 보기

소개

활동 데이터를 달력(히트맵)에 표시하는 React 컴포넌트

생산성 및 자동화

이 수치를 측정하는 방법

What you can do

  • any number of activity levels, including negative ones
  • dark and light mode

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+2
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

React Activity Calendar

Tests Playwright tests npm version

A React component to display activity data in a calendar (heatmap).
Documentation (Storybook)

Version 3 has been released 🎉
See the upgrade guide.

Screenshot

Installation

npm install react-activity-calendar

Features

  • any number of activity levels, including negative ones
  • color themes
  • dark and light mode
  • tooltips
  • event handlers
  • localization

The component expects activity data in the following shape, where each activity level must be in the bounds controlled by the minLevel and maxLevel props. By default, the level bounds are [0, 4] but any range is possible (see documentation). It is up to you how to generate and classify your data.

import { ActivityCalendar } from 'react-activity-calendar'

const data = [
  {
    date: '2024-06-23',
    count: 2,
    level: 1,
  },
  {
    date: '2024-08-02',
    count: 16,
    level: 4,
  },
  {
    date: '2024-11-29',
    count: 11,
    level: 3,
  },
]

function Calendar() {
  return <ActivityCalendar data={data} />
}

FAQ

Why does the calendar not render in environment x?

If you encounter issues rendering this component in a specific React framework, please refer to the following repository. It contains working examples for Astro, Next.js, Remix and Vite. Server side rendering (SSR) is supported.

Framework examples

Why is Create React App unsupported?

Create React App (CRA) is considered abandoned, and you probably should not use it anymore (more background). Using this component inside CRA will lead to errors for reasons described in issue #105. This repo is not for CRA support questions. If you encounter issues, you need to fix those yourself given the maintenance state of CRA. Personally, I would recommend using Vite instead of CRA.

Development

Start the Storybook

npm run dev

Update the documentation

npm run build:storybook

Related projects

관련 프로젝트 살펴보기

불러오는 중…