Componentpickers1.83 KB gzipZero dependencies
Calendar
Month calendar with date selection, month navigation, and today indicator.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add calendarOr install the full npm package:
npm install bigbulluiUsage
tsx6 lines
import { Calendar } from "@/components/ui/calendar"; <Calendar defaultValue={new Date()} onValueChange={(date) => console.log(date)}/>Source code
calendar.tsx + 2 helpersZero 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 />| Prop | Type | Description |
|---|---|---|
| value | Date | Controlled value. |
| defaultValue | Date | Initial value when uncontrolled. |
| onValueChange | (d: Date) => void | Callback invoked on value change. |
| minDate | Date | Configures min date. |
| maxDate | Date | Configures max date. |
| locale | string | Configures locale. (Default: "en-US") |
| weekStartsOn | 0 | 1 | Configures week starts on. (Default: 0) |
| aria-label | string | Configures aria label. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |