8bit

Search docs

Search for a docs page

Calendar

A date field component that lets users enter and edit dates.

July 2026

Installation

pnpm dlx shadcn@latest add https://8bit.cnlibs.com/r/calendar.json

Usage

"use client";

import { useState } from "react";
import { Calendar } from "@/components/ui/calendar";

const [date, setDate] = useState<Date | undefined>(new Date());
<Calendar
  className="px-border-md px-rounded-md"
  mode="single"
  onSelect={setDate}
  selected={date}
/>