calendar-custom-days.tsx — ui Source File
Architecture documentation for calendar-custom-days.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 71b1c790_5dfe_d348_e71d_ab6d4906e3d1["calendar-custom-days.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 71b1c790_5dfe_d348_e71d_ab6d4906e3d1 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 4bae96d1_8974_035f_9042_62ec299030b9["calendar"] 71b1c790_5dfe_d348_e71d_ab6d4906e3d1 --> 4bae96d1_8974_035f_9042_62ec299030b9 a3f5dc6c_2f22_a06c_c4d4_d84a4ed2818e["card"] 71b1c790_5dfe_d348_e71d_ab6d4906e3d1 --> a3f5dc6c_2f22_a06c_c4d4_d84a4ed2818e f9e8c1ea_9de4_3e04_ca27_b15cada2e81e["date-fns"] 71b1c790_5dfe_d348_e71d_ab6d4906e3d1 --> f9e8c1ea_9de4_3e04_ca27_b15cada2e81e bfc8708c_7488_3983_8998_32b793781735["react-day-picker"] 71b1c790_5dfe_d348_e71d_ab6d4906e3d1 --> bfc8708c_7488_3983_8998_32b793781735 style 71b1c790_5dfe_d348_e71d_ab6d4906e3d1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { Calendar, CalendarDayButton } from "@/examples/radix/ui/calendar"
import { Card, CardContent } from "@/examples/radix/ui/card"
import { addDays } from "date-fns"
import { type DateRange } from "react-day-picker"
export function CalendarCustomDays() {
const [range, setRange] = React.useState<DateRange | undefined>({
from: new Date(new Date().getFullYear(), 11, 8),
to: addDays(new Date(new Date().getFullYear(), 11, 8), 10),
})
return (
<Card className="mx-auto w-fit p-0">
<CardContent className="p-0">
<Calendar
mode="range"
defaultMonth={range?.from}
selected={range}
onSelect={setRange}
numberOfMonths={1}
captionLayout="dropdown"
className="[--cell-size:--spacing(10)] md:[--cell-size:--spacing(12)]"
formatters={{
formatMonthDropdown: (date) => {
return date.toLocaleString("default", { month: "long" })
},
}}
components={{
DayButton: ({ children, modifiers, day, ...props }) => {
const isWeekend =
day.date.getDay() === 0 || day.date.getDay() === 6
return (
<CalendarDayButton day={day} modifiers={modifiers} {...props}>
{children}
{!modifiers.outside && (
<span>{isWeekend ? "$120" : "$100"}</span>
)}
</CalendarDayButton>
)
},
}}
/>
</CardContent>
</Card>
)
}
Domain
Subdomains
Functions
Dependencies
- calendar
- card
- date-fns
- react
- react-day-picker
Source
Frequently Asked Questions
What does calendar-custom-days.tsx do?
calendar-custom-days.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, Changelog subdomain.
What functions are defined in calendar-custom-days.tsx?
calendar-custom-days.tsx defines 1 function(s): CalendarCustomDays.
What does calendar-custom-days.tsx depend on?
calendar-custom-days.tsx imports 5 module(s): calendar, card, date-fns, react, react-day-picker.
Where is calendar-custom-days.tsx in the architecture?
calendar-custom-days.tsx is located at apps/v4/examples/radix/calendar-custom-days.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/examples/radix).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free