DocumentationNuxt Charts v3

Contribution Graph

A GitHub-style calendar heatmap for visualizing daily activity over a year.

The ContributionGraph component requires Vue and Tailwind CSS and inherits Nuxt UI colors when available. It plots a value per day across a year as a calendar heatmap — the familiar GitHub "contributions" grid. Use it for commit activity, usage density, streaks, publishing cadence or any per-day metric where the pattern over time matters more than exact values.

Example

Each column is a week, each cell a day; color intensity scales with the day's count. Hover a cell for its value.

Learn how to use the Nuxt Charts CLI to get premium components.

Data

Pass a sparse array of { date, count } objects. Dates use the YYYY-MM-DD format and only active days need an entry — any day without one is rendered as the empty (level 0) state. The grid starts on the Sunday of the earliest date's week so every column is a full seven-day week.

Props

PropTypeDefaultDescription
data{ date: string, count: number }[]RequiredSparse list of day → count. Missing days are treated as 0.
levelsnumber4Number of intensity buckets (excluding the empty state).
colorstringvar(--ui-primary)Base color for the highest intensity; lower levels fade from it.
cellSizenumber12Size of each day cell in pixels.
cellGapnumber3Gap between cells in pixels.
cellRadiusnumber2Corner radius of each cell in pixels.
showWeekdayLabelsbooleantrueShow the Mon / Wed / Fri labels column.
showMonthLabelsbooleantrueShow the month labels row.
showLegendbooleantrueShow the Less → More legend.
maxCountnumberdata maxExplicit upper bound for the color scale.
tooltipFormatter(day) => string—Custom tooltip text for a day.
startDate / endDatestringData boundsExplicit YYYY-MM-DD bounds; use these to show inactive periods.
localestring'en-US'Locale for month names, weekday labels, and tooltip dates.
labelstring'Daily activity'Accessible name for the chart.
lessLabel / moreLabelstring'Less' / 'More'Legend text.
emptyColorstringNuxt UI elevated background, then Tailwind grayColor for inactive cells.
showTooltipbooleantrueShow native SVG tooltips.

Date calculations use UTC so cells stay aligned in every timezone. Empty data displays no cells unless explicit bounds are supplied. Colors accept CSS variables; Tailwind color variables provide defaults when Nuxt UI is absent.