BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/SmoothUI Registry/contribution-graph

Contribution Graph

smoothui-registry/contribution-graph
FreeComponent

A ContributionGraph component for SmoothUI.

Install it

npx shadcn@latest add https://www.smoothui.dev/r/contribution-graph.json

Source

index.tsxwww.smoothui.dev/r/contribution-graph.json · first 6 KB
1"use client";
2
3import { motion, useReducedMotion } from "motion/react";
4import type React from "react";
5import { useMemo, useState } from "react";
6
7export interface ContributionData {
8 count: number;
9 date: string;
10 level: number;
11}
12
13export interface ContributionGraphProps {
14 className?: string;
15 data?: ContributionData[];
16 showLegend?: boolean;
17 showTooltips?: boolean;
18 year?: number;
19}
20
21const WEEKS_IN_YEAR = 53;
22const DAYS_IN_WEEK = 7;
23const JANUARY_MONTH = 0;
24const DECEMBER_MONTH = 11;
25const SUNDAY_DAY = 0;
26const MIN_WEEKS_FOR_DECEMBER_HEADER = 2;
27const TOOLTIP_OFFSET_X = 10;
28const TOOLTIP_OFFSET_Y = 40;
29
30const MONTHS = [
31 "Jan",
32 "Feb",
33 "Mar",
34 "Apr",
35 "May",
36 "Jun",
37 "Jul",
38 "Aug",
39 "Sep",
40 "Oct",
41 "Nov",
42 "Dec",
43];
44
45const DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
46
47// Contribution level colors (similar to GitHub's)
48const CONTRIBUTION_COLORS = [
49 "bg-primary", // Level 0 - No contributions
50 "bg-brand/25", // Level 1
51 "bg-brand/50", // Level 2
52 "bg-brand/75", // Level 3
53 "bg-brand", // Level 4 - Max
54];
55
56const LEVEL_0 = 0;
57const LEVEL_1 = 1;
58const LEVEL_2 = 2;
59const LEVEL_3 = 3;
60const LEVEL_4 = 4;
61const CONTRIBUTION_LEVELS = [LEVEL_0, LEVEL_1, LEVEL_2, LEVEL_3, LEVEL_4];
62const DAY_1 = 1;
63const DAY_31 = 31;
64
65// Helper function to check if date is in valid range
66const isDateInValidRange = (
67 currentDate: Date,
68 startDate: Date,
69 endDate: Date,
70 targetYear: number
71) => {
72 const isInRange = currentDate >= startDate && currentDate <= endDate;
73 const isPreviousYearDecember =
74 currentDate.getFullYear() === targetYear - 1 &&
75 currentDate.getMonth() === DECEMBER_MONTH;
76 const isNextYearJanuary =
77 currentDate.getFullYear() === targetYear + 1 &&
78 currentDate.getMonth() === JANUARY_MONTH;
79 return isInRange || isPreviousYearDecember || isNextYearJanuary;
80};
81
82// Helper function to create day data
83const createDayData = (
84 currentDate: Date,
85 contributionData: ContributionData[]
86): ContributionData => {
87 const [dateString] = currentDate.toISOString().split("T");
88 const existingData = contributionData.find((d) => d.date === dateString);
89 return {
90 count: existingData?.count ?? LEVEL_0,
91 date: dateString,
92 level: existingData?.level ?? LEVEL_0,
93 };
94};
95
96// Helper function to check if month should be shown
97interface MonthHeaderCheck {
98 currentMonth: number;
99 currentYear: number;
100 startDateDay: number;
101 targetYear: number;
102 weekCount: number;
103}
104const shouldShowMonthHeader = ({
105 currentYear,
106// … truncated

What it pulls in

npm packages

  • motion

Other registry items

  • https://smoothui.dev/r/tokens.json

Files it writes

  • index.tsx

Facts

Registry
SmoothUI Registry
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-09
Last confirmed
yesterday

Go to the source

www.smoothui.dev educlopez/smoothui on GitHub Raw registry item This item as JSON

More from SmoothUI Registry

All 178 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Agent Avataragent-avatarSmoothUI RegistryComponentsFreeno deps
Ai Approvalai-approvalSmoothUI RegistryComponentsFree2 deps
Ai Artifactai-artifactSmoothUI RegistryComponentsFree2 deps
Ai Branchai-branchSmoothUI RegistryComponentsFree2 deps
Ai Citationai-citationSmoothUI RegistryComponentsFree2 deps
Ai Context Meterai-context-meterSmoothUI RegistryComponentsFree2 deps
Ai Conversationai-conversationSmoothUI RegistryComponentsFree2 deps
Ai Coreai-coreSmoothUI RegistryComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex