Contribution Field
Your GitHub year as a field of dots: busy days bigger and deeper, quiet ones a faint grain, growing in week by week as it comes into view. The days under your cursor lift like grass in a breeze and the line below reads out the day; a click sends a ripple across the year.
Needs: None. A 2D canvas. Bring your own data: GitHub's contributionCalendar from the GraphQL API, flattened to { date, count }.
Customize
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| data | { date: string; count: number }[] | required | Your contribution days, dates as YYYY-MM-DD. |
| weeks | number | 53 | How many weeks to show, ending with the latest day in data. |
| tone | string | "#3fae5a" | The colour of a busy day; quieter days are lighter shades of it. |
| labels | boolean | true | Month names above, and a line below that reads out the day under the cursor. |
| grow | boolean | true | The year grows in week by week when it first comes into view. |
| interactive | boolean | true | Hover lifts the days under the cursor; a click sends a ripple out from a day. |
| onSelect | (day: { date: string; count: number }) => void | – | Called with the day you click. |
| className | string | – | Class on the root, which fills its parent's width. |
| style | CSSProperties | – | Style on the root. Theme it through the --mlui-* variables. |