Contribution Graph

A clean, accessible contribution calendar with built-in data normalization, keyboard navigation, day tooltips, and responsive latest-day visibility.

Installation

npx shadcn@latest add @navui/contribution-graph

Usage

Pass daily dates and counts. Missing days and intensity levels are calculated by the component.

import { ContributionGraph } from '@/components/navui/contribution-graph'

export function Example() {
  return (
    <ContributionGraph
      aria-label="Project activity"
      data={{ days: [{ date: '2026-11-01', count: 3 }, { date: '2026-11-03', count: 7 }] }}
    />
  )
}

API reference

Custom NavUI component.

Contribution Graph properties
PropTypeDefaultDescription
dataRequiredContributionGraphData—Daily { date, count } values. Intensity, total, and date range are calculated when omitted.
emptyMessagestringContextual fallback messageMessage rendered when the daily data array is empty.
title / descriptionstring / stringContribution activity / -Visible heading with optional supporting context.
showHeaderbooleantrueHides the visible heading and total for compact embeds while preserving an accessible summary.

Accessibility

  • Use arrow keys, Home, and End to review individual days. Counts are named in text as well as shown by intensity. Empty data renders a fallback.