UNPKG

772 BTypeScriptView Raw
1import React from "react";
2
3import type { CalendarDay } from "../classes/index.js";
4import type { Modifiers } from "../types/index.js";
5
6/**
7 * Render the gridcell of a day in the calendar and handle the interaction and
8 * the focus with they day.
9 *
10 * If you need to just change the content of the day cell, consider swapping the
11 * `DayDate` component instead.
12 *
13 * @group Components
14 * @see https://daypicker.dev/guides/custom-components
15 */
16export function Day(
17 props: {
18 /** The day to render. */
19 day: CalendarDay;
20 /** The modifiers to apply to the day. */
21 modifiers: Modifiers;
22 } & JSX.IntrinsicElements["td"]
23) {
24 const { day, modifiers, ...tdProps } = props;
25 return <td {...tdProps} />;
26}
27
28export type DayProps = Parameters<typeof Day>[0];