DatePicker API

API reference docs for theDatePickercomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropTypeDescriptionDefault
calendar((props: { close: (selectedDate?: Date) => void }) => React.ReactElement<CalendarProps>) | React.ReactElement<CalendarProps>The element to be rendered inside of the popover when opened. Preferably a Calendar component._
formattedValue?React.ReactNodeCustomise how the value is presented in the default trigger._
trigger?(props: { triggerProps: ButtonProps; isOpen: boolean; placeholder: string; }) => React.ReactElement<ButtonProps>Custom trigger component._
placeholderstringPlaceholder text to be displayed in the date picker trigger._
onClose?(selectedDate?: Date) => voidThis callback is invoked after the popover has been closed and does not automatically reset the visible month. Consumers can use this event to update or reset state as needed._