Function: useDayPicker()

May 8, 2026 ยท View on GitHub

useDayPicker<T>(): DayPickerContext<T>

Defined in: packages/react-day-picker/src/useDayPicker.ts:83

Provides access to the DayPicker context, which includes properties and methods to interact with the DayPicker component. This hook must be used within a custom component.

Type Parameters

Type ParameterDescription
T extends { mode?: Mode; required?: boolean; }Use this type to refine the returned context type with a specific selection mode.

Returns

DayPickerContext<T>

The context to work with DayPicker.

Throws

If the hook is used outside of a DayPicker provider.

See

https://daypicker.dev/guides/custom-components