halaska-studio

Calendar

Component

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>
  );
}

More by halaska-studio

View all
  • Dot Grid

    Dot Grid

    24
  • Orb

    Orb

    15
  • Segmented Control

    Segmented Control

    8
  • Choicebox

    Choicebox

    6
  • Combobox

    Combobox

    5
  • Dialog

    Dialog

    4
  • Input OTP

    Input OTP

    4
  • Table

    Table

    2