calender
jolyui-ui/calenderFreeComponent
jolyui/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by jolyui/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://jolyui.dev/r/calender.jsonSource
1import {2 addDays,3 addMonths,4 addYears,5 eachDayOfInterval,6 endOfMonth,7 endOfWeek,8 endOfYear,9 format,10 getDay,11 getHours,12 getMinutes,13 getMonth,14 getYear,15 isAfter,16 isBefore,17 isSameDay,18 isSameMonth,19 isToday,20 isWeekend,21 isWithinInterval,22 type Locale,23 setHours,24 setMinutes,25 setMonth,26 setYear,27 startOfDay,28 startOfMonth,29 startOfWeek,30 startOfYear,31 subDays,32 subMonths,33 subYears,34} from "date-fns";35import { enUS } from "date-fns/locale";36import {37 AlertCircle,38 Calendar as CalendarIcon,39 Check,40 ChevronLeft,41 ChevronRight,42 ChevronsLeft,43 ChevronsRight,44 Clock,45 X,46} from "lucide-react";47import { AnimatePresence, motion, useReducedMotion } from "motion/react";48import * as React from "react";49import {50 useCallback,51 useEffect,52 useId,53 useMemo,54 useRef,55 useState,56} from "react";57import { Button } from "@/components/ui/button";58import {59 Popover,60 PopoverContent,61 PopoverTrigger,62} from "@/components/ui/popover";63import { cn } from "@/lib/utils";6465// ============================================================================66// TYPES67// ============================================================================6869export type CalendarMode = "single" | "range" | "multiple";70export type CalendarView = "days" | "months" | "years" | "time";71export type CalendarSize = "sm" | "md" | "lg";7273export interface DateRange {74 from: Date | undefined;75 to: Date | undefined;76}7778export interface PresetRange {79 label: string;80 getValue: () => DateRange;81}8283export interface CalendarLocale {84 weekdays: string[];85 weekdaysShort: string[];86 months: string[];87 monthsShort: string[];88 today: string;89 clear: string;90 close: string;91 selectTime: string;92 backToCalendar: string;93 selected: string;94 weekNumber: string;95}9697// Base props shared by all modes98interface BaseCalendarProps {99 // Display100 placeholder?: string;101 disabled?: boolean;102 readOnly?: boolean;103 required?: boolean;104 className?: string;105 size?: CalendarSize;106107 // Constraints108 minDate?: Date;109 maxDate?: Date;110 disabledDates?: Date[];111 disabledDaysOfWeek?: number[];112 disableWeekends?: boolean;113 disablePastDates?: boolean;114 disableFutureDates?: boolean;115116 // Validation117 error?: boolean;118 errorMessage?: string;119120 // Features121 showTime?: boolean;122 use24Hour?: boolean;123 minuteStep?: number;124 showWeekNumbers?: boolean;125 showTodayButton?: boolean;126 showClearButton?: boolean;127 weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;128// … truncated
What it pulls in
npm packages
Files it writes
More from jolyui/ui
All 199 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| ai-prompt-boxai-prompt-box | jolyui/ui | Components | Free | 4 deps | |
| animated-beamanimated-beam | jolyui/ui | Components | Free | 1 dep | |
| animated-tableanimated-table | jolyui/ui | Components | Free | 2 deps | |
| animated-theme-toggleanimated-theme-toggle | jolyui/ui | Components | Free | 2 deps | |
| animated-toastanimated-toast | jolyui/ui | Components | Free | 2 deps | |
| animated-tooltipanimated-tooltip | jolyui/ui | Components | Free | 1 dep | |
| bento-gridbento-grid | jolyui/ui | Components | Free | no deps | |
| buttonbutton | jolyui/ui | Components | Free | 3 deps |
