About
An inline month-view date picker grid with previous/next navigation, a highlighted today marker, and a filled selected day, for choosing or clearing a single date.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Calendar to your project and fits it to your theme.
Code
How Calendar is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import Calendar from "@/components/ui/calendar";
import { useState } from "react";
export default function CalendarControlledDemo() {
const [followUp, setFollowUp] = useState(null);
return (
<div className="flex flex-row items-center gap-6">
<Calendar value={followUp} onChange={setFollowUp} />
<div className="flex flex-col gap-3 w-[180px]">
<p className="text-sm text-muted-foreground">
{followUp
? `Follow up with Acme on ${followUp.toLocaleDateString("en-AU", { day: "numeric", month: "long" })}`
: "No follow-up date set"}
</p>
<button
type="button"
disabled={!followUp}
onClick={() => setFollowUp(null)}
className="h-8 rounded-md border border-input bg-transparent px-3 text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed hover:bg-accent"
>
Clear date
</button>
</div>
</div>
);
}








