uibrik

Streak Calendar

New

Preview

Customize

Weeks20
Sunday
Sample streak12
Accent
Seed7

Usage

import { StreakCalendar } from "@/components/uibrik/streak-calendar/streak-calendar";

<StreakCalendar />

Installation

npx shadcn@latest add https://uibrik.com/r/streak-calendar.json
Adds the files to components/uibrik/streak-calendar and installs @number-flow/react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/streak-calendar.

Props

StreakCalendar
weeks
Type number
20
Most weeks of history to show; fewer fit on narrow screens.
weekStart
Type "sunday" | "monday"
"sunday"
Day the week starts on.
streak
Type number
12
Days in a row already logged before today, for the sample data.
accent
Type string
"#22c55e"
Colour of logged days.
unit
Type string
"sessions"
Unit shown in the tooltip.
seed
Type number
7
Seeds the sample history.
data
Type number[]
–
Count per day, oldest first, ending today. Replaces the sample data; shades are scaled to the busiest day.
onLogChange
Type (logged: boolean) => void
–
Called when today is logged, or the log is undone.
className
Type string
–
Classes for the outer shell.