Skip to main content
Version: 9.14.0

Type Alias: DayPickerContext<T>

DayPickerContext<T> = { classNames: ClassNames; components: CustomComponents; dayPickerProps: DayPickerProps; formatters: Formatters; getModifiers: (day) => Modifiers; goToMonth: (month) => void; isSelected: (date) => boolean | undefined; labels: Labels; months: CalendarMonth[]; nextMonth: Date | undefined; previousMonth: Date | undefined; select: SelectHandler<T> | undefined; selected: SelectedValue<T> | undefined; styles: Partial<Styles> | undefined; }

Defined in: src/useDayPicker.ts:34

Represents the context for the DayPicker component, providing various properties and methods to interact with the calendar.

Type Parameters​

Properties​

classNames​

classNames: ClassNames

Defined in: src/useDayPicker.ts:56

The class names for the UI elements.


components​

components: CustomComponents

Defined in: src/useDayPicker.ts:54

The components used internally by DayPicker.


dayPickerProps​

dayPickerProps: DayPickerProps

Defined in: src/useDayPicker.ts:68

The props as passed to the DayPicker component.

Since​

9.3.0


formatters​

formatters: Formatters

Defined in: src/useDayPicker.ts:62

The formatters used to format the UI elements.


getModifiers()​

getModifiers: (day) => Modifiers

Defined in: src/useDayPicker.ts:46

Returns the modifiers for the given day.

Parameters​

Returns​

Modifiers


goToMonth()​

goToMonth: (month) => void

Defined in: src/useDayPicker.ts:44

Navigate to the specified month. Will fire the onMonthChange callback.

Parameters​

Returns​

void


isSelected​

isSelected: (date) => boolean | undefined

Defined in: src/useDayPicker.ts:52

Whether the given date is selected.


labels​

labels: Labels

Defined in: src/useDayPicker.ts:60

The labels used in the user interface.


months​

months: CalendarMonth[]

Defined in: src/useDayPicker.ts:38

The months displayed in the calendar.


nextMonth​

nextMonth: Date | undefined

Defined in: src/useDayPicker.ts:40

The next month to display.


previousMonth​

previousMonth: Date | undefined

Defined in: src/useDayPicker.ts:42

The previous month to display.


select​

select: SelectHandler<T> | undefined

Defined in: src/useDayPicker.ts:50

Set a selection.


selected​

selected: SelectedValue<T> | undefined

Defined in: src/useDayPicker.ts:48

The selected date(s).


styles​

styles: Partial<Styles> | undefined

Defined in: src/useDayPicker.ts:58

The styles for the UI elements.