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-graphUsage
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.
| Prop | Type | Default | Description |
|---|---|---|---|
dataRequired | ContributionGraphData | — | Daily { date, count } values. Intensity, total, and date range are calculated when omitted. |
emptyMessage | string | Contextual fallback message | Message rendered when the daily data array is empty. |
title / description | string / string | Contribution activity / - | Visible heading with optional supporting context. |
showHeader | boolean | true | Hides 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.