BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/einui/calendar-widget

Calendar Widgets

einui/calendar-widget
FreeComponent

Calendar widgets for displaying dates, events, and scheduling information.

Live preview

live · rendered by the registry
Rendered by einui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.eindev.ir/r/calendar-widget.json

Source

registry/widgets/calendar-widget.tsxui.eindev.ir/r/calendar-widget.json · first 6 KB
1"use client";
2
3import * as React from "react";
4import { cn } from "@/lib/utils";
5import { ChevronLeft, ChevronRight, Plus, Clock } from "lucide-react";
6import { GlassWidgetBase } from "./base-widget";
7
8// Helper: returns the start-of-month Date for a given date
9function getMonthStart(date: Date) {
10 return new Date(date.getFullYear(), date.getMonth(), 1);
11}
12
13interface CalendarWidgetProps {
14 date?: Date;
15 selectedDate?: Date;
16 onDateSelect?: (date: Date) => void;
17 className?: string;
18}
19
20function CalendarWidget({
21 date,
22 selectedDate,
23 onDateSelect,
24 className,
25}: CalendarWidgetProps) {
26 const [internalDate, setInternalDate] = React.useState<Date | null>(date ?? null);
27
28 // Always create the month state (avoid conditional hooks). Use a deterministic fallback date.
29 const [currentMonth, setCurrentMonth] = React.useState<Date>(() =>
30 getMonthStart(date ?? new Date(0))
31 );
32
33 // On mount/client, set "now" if no date prop was provided.
34 React.useLayoutEffect(() => {
35 // eslint-disable-next-line react-hooks/set-state-in-effect
36 if (!date) setInternalDate(new Date());
37 }, [date]);
38
39 // When internalDate is ready, sync currentMonth.
40 React.useLayoutEffect(() => {
41 if (internalDate) {
42 // eslint-disable-next-line react-hooks/set-state-in-effect
43 setCurrentMonth(getMonthStart(internalDate));
44 }
45 }, [internalDate]);
46
47 if (!internalDate) {
48 // Lightweight client-side loading state to avoid using `new Date()` during prerender
49 return (
50 <GlassWidgetBase className={cn("min-w-60 p-4", className)} glowColor="purple">
51 <div className="h-6 w-36 bg-white/8 rounded animate-pulse" />
52 <div className="h-36 w-full mt-3 bg-white/8 rounded animate-pulse" />
53 </GlassWidgetBase>
54 );
55 }
56
57 const selected = selectedDate ?? internalDate;
58
59 const monthName = currentMonth.toLocaleDateString("en-US", { month: "short" });
60 const year = currentMonth.getFullYear();
61
62 const firstDay = new Date(currentMonth.getFullYear(), currentMonth.getMonth(), 1);
63 const lastDay = new Date(currentMonth.getFullYear(), currentMonth.getMonth() + 1, 0);
64 const startPadding = firstDay.getDay();
65 const daysInMonth = lastDay.getDate();
66
67 const days = Array.from({ length: startPadding + daysInMonth }, (_, i) => {
68 if (i < startPadding) return null;
69 return i - startPadding + 1;
70 });
71
72 const prevMonth = () => {
73 setCurrentMonth(new Date(currentMonth.getFullYear(), currentMonth.getMonth() - 1, 1));
74 };
75
76// … truncated

What it pulls in

npm packages

  • lucide-react

Other registry items

  • https://ui.eindev.ir/r/base-widget.json

Files it writes

  • registry/widgets/calendar-widget.tsx

Facts

Registry
einui
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-13
Last confirmed
yesterday

Go to the source

Docs on einui ui.eindev.ir einui/einui on GitHub Raw registry item This item as JSON

More from einui

All 44 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Base Widgetbase-widgeteinuiComponentsFree1 dep
Clock Widgetsclock-widgeteinuiComponentsFree1 dep
Glass Alert Dialogglass-alert-dialogeinuiComponentsFree1 dep
Glass Avatarglass-avatareinuiComponentsFree1 dep
Glass Badgeglass-badgeeinuiComponentsFree1 dep
Glass Breadcrumbglass-breadcrumbeinuiComponentsFree1 dep
Glass Buttonglass-buttoneinuiComponentsFree2 deps
Glass Cardglass-cardeinuiComponentsFreeno deps

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