🎨Design & Customizations
Day object holds most of the props you need when it comes to styling your calendar's days grid.
disabled-trueif the day is disabled to select for whatever reason. Usually useful when havingallowPast,minDateetc... (Checkout Calendar options for more)isToday-trueif it's the day is today. For a more convenient user experience, you really want to distinct today sometimes.isWeekend-trueif the day is a weekend (locale-aware)isInCurrentMonth -
trueif the day is in the range of the displayed month it is rendered within. relevant for when usingweeksarray of theMonth
<div className="daysGrid">
{month.weeks.map((week) => {
return week.days.map((day) => {
return (
<div
style={{
opacity: day.isInCurrentMonth ? "1" : "0.5",
backgroundColor: day.isToday ? "yellow" : "white",
color: day.isWeekend ? "red" : "black",
}}
{...register(month, day)}
>
{day.number}
</div>
);
});
})}Last updated