Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bar List
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Checkbox
- Checkbox Group
- Circular Progress
- Collapsible
- Combobox
- Command
- Context Menu
- Currency Input
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Meter
- Multi Combobox
- Native Select
- Navigation Menu
- Number Field
- Pagination
- Phone Input
- Popover
- Progress
- Progress List
- Prompt
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Stat
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
- Typography
Loading...
"use client";
import { useState } from "react";
import { Calendar } from "@/components/ui/calendar";
export function CalendarDemo() {
const [date, setDate] = useState<Date | undefined>(new Date());
return (
<Calendar
captionLayout="dropdown"
className="rounded-lg border"
mode="single"
onSelect={setDate}
selected={date}
/>
);
}About
The Calendar component is built on top of React DayPicker.
Installation
npx shadcn@latest add "https://ui.blode.co/r/styles/default/calendar"
Usage
import { Calendar } from "@/components/ui/calendar";const [date, setDate] = React.useState<Date | undefined>(new Date());
return (
<Calendar
mode="single"
selected={date}
onSelect={setDate}
className="rounded-md border"
/>
);See the React DayPicker documentation for more information.
Date Picker
You can use the <Calendar> component to build a date picker. See the Date Picker page for more information.
Changelog
11-03-2024 day_outside color
-
Changed the color of the
day_outsideclass to the following to improve contrast:calendar.tsx "day_outside: "day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",