Heatmap
Server ComponentA calendar-style contribution heatmap that buckets daily activity into levels.
Import
tsx
import { Heatmap } from "@cronus-ui/ui";
bash
npx cronus-ui add heatmap
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component HeatmapDefault layout:inline style:heatmap {
data:"0,1,4,2,8,3,1,0,2,6,4,1,3,5"
aria-label:"Activity"
label "Activity"
}
page "/audit/heatmap/default" type:custom {
use HeatmapDefault
}
API Reference
Generated from the component's exported types.
HeatmapProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
data* | HeatmapDay[] | — | One item per day, laid out into week columns of 7 (top → bottom). |
levels | number | 5 | Number of discrete levels including the empty level 0. |
weekCount | number | — | Hint for the intended number of week columns. Ignored — the data drives the layout — but accepted so callers can document intent. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |