Componentpickers1.83 KB gzipZero dependencies

Calendar

Month calendar with date selection, month navigation, and today indicator.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add calendar

Or install the full npm package:

npm install bigbullui

Usage

tsx6 lines
import { Calendar } from "@/components/ui/calendar"; <Calendar  defaultValue={new Date()}  onValueChange={(date) => console.log(date)}/>

Source code

calendar.tsx + 2 helpers

Zero third-party dependencies (3 local files shown in tabs below).

tsxcalendar.tsx260 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils";import { useIsMounted } from "./lib/react-compat"; export interface CalendarProps extends Omit<React.HTMLAttributes<HTMLElement>, "value" | "defaultValue"> {  value?: Date;  defaultValue?: Date;  onValueChange?: (d: Date) => void;  minDate?: Date;  maxDate?: Date;  locale?: string;  weekStartsOn?: 0 | 1;  "aria-label"?: string;  className?: string;} 

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { Calendar } from "@/components/ui/calendar"; <Calendar />
PropTypeDescription
valueDateControlled value.
defaultValueDateInitial value when uncontrolled.
onValueChange(d: Date) => voidCallback invoked on value change.
minDateDateConfigures min date.
maxDateDateConfigures max date.
localestringConfigures locale. (Default: "en-US")
weekStartsOn0 | 1Configures week starts on. (Default: 0)
aria-labelstringConfigures aria label.
classNamestringOptional Tailwind or custom CSS classes merged with component styles.