Interface: DayPickerSingleProps
The props for the DayPicker component when using mode="single"
.
Hierarchyβ
β³
DayPickerSingleProps
Propertiesβ
captionLayoutβ
β’ Optional
captionLayout: CaptionLayout
Change the layout of the caption:
buttons
(default): display prev/right buttonsdropdown
: display drop-downs to change the month and the year
Note: the dropdown
layout is available only when fromDate
,
fromMonth
orfromYear
and toDate
, toMonth
or toYear
are set.
Inherited fromβ
Defined inβ
classNameβ
β’ Optional
className: string
The CSS class to add to the container element.
Inherited fromβ
Defined inβ
classNamesβ
β’ Optional
classNames: Partial
<StyledElement
<string
>>
Change the class names of the HTML elements.
Use this prop when you need to change the default class names β for example when using CSS modules.
Inherited fromβ
Defined inβ
componentsβ
β’ Optional
components: CustomComponents
A map of components used to create the layout.
Inherited fromβ
Defined inβ
defaultMonthβ
β’ Optional
defaultMonth: Date
The initial month to show in the calendar. Default is the current month.
Use this prop to let DayPicker control the current month. If you need to set the month programmatically, use month and onMonthChange.
Inherited fromβ
Defined inβ
dirβ
β’ Optional
dir: string
The text direction of the calendar. Use ltr
for left-to-right (default)
or rtl
for right-to-left.
Inherited fromβ
Defined inβ
disableNavigationβ
β’ Optional
disableNavigation: boolean
Disable the navigation between months.
Inherited fromβ
DayPickerBase.disableNavigation
Defined inβ
disabledβ
β’ Optional
disabled: Matcher
| Matcher
[]
Apply the disabled
modifier to the matching days.
Inherited fromβ
Defined inβ
fixedWeeksβ
β’ Optional
fixedWeeks: boolean
Display six weeks per months, regardless the monthβs number of weeks.
To use this prop, showOutsideDays must be set. Default to false
.
Inherited fromβ
Defined inβ
footerβ
β’ Optional
footer: ReactNode
Content to add to the tfoot
element.
Inherited fromβ
Defined inβ
formattersβ
β’ Optional
formatters: Partial
<Formatters
>
A map of formatters. Use the formatters to override the default formatting functions.
Inherited fromβ
Defined inβ
fromDateβ
β’ Optional
fromDate: Date
The earliest day to start the month navigation.
Inherited fromβ
Defined inβ
fromMonthβ
β’ Optional
fromMonth: Date
The earliest month to start the month navigation.
Inherited fromβ
Defined inβ
fromYearβ
β’ Optional
fromYear: number
The earliest year to start the month navigation.
Inherited fromβ
Defined inβ
hiddenβ
β’ Optional
hidden: Matcher
| Matcher
[]
Apply the hidden
modifier to the matching days. Will hide them from the
calendar.
Inherited fromβ
Defined inβ
hideHeadβ
β’ Optional
hideHead: boolean
Hide the monthβs head displaying the weekday names.
Inherited fromβ
Defined inβ
initialFocusβ
β’ Optional
initialFocus: boolean
When a selection mode is set, DayPicker will focus the first selected day (if set) or the today's date (if not disabled).
Use this prop when you need to focus DayPicker after a user actions, for improved accessibility.
Inherited fromβ
Defined inβ
labelsβ
β’ Optional
labels: Partial
<Labels
>
Labels creators to override the defaults. Use this prop to customize the ARIA labels attributes.
Inherited fromβ
Defined inβ
localeβ
β’ Optional
locale: Locale
The date-fns locale object used to localize dates. Defaults to* en-US
.
Inherited fromβ
Defined inβ
modeβ
β’ mode: "single"
Defined inβ
modifiersβ
β’ Optional
modifiers: DayModifiers
Add modifiers to the matching days.
Inherited fromβ
Defined inβ
modifiersClassNamesβ
β’ Optional
modifiersClassNames: ModifiersClassNames
Change the class name for the day matching the modifiers.
Inherited fromβ
DayPickerBase.modifiersClassNames
Defined inβ
modifiersStylesβ
β’ Optional
modifiersStyles: ModifiersStyles
Change the inline style for the day matching the modifiers.
Inherited fromβ
Defined inβ
monthβ
β’ Optional
month: Date
The month to display in the calendar.
As opposed to defaultMonth, use this prop with onMonthChange to change the month programmatically.
Inherited fromβ
Defined inβ
numberOfMonthsβ
β’ Optional
numberOfMonths: number
The number of displayed months. Defaults to 1
.
Inherited fromβ
Defined inβ
onDayBlurβ
β’ Optional
onDayBlur: DayFocusEventHandler
Inherited fromβ
Defined inβ
onDayClickβ
β’ Optional
onDayClick: DayClickEventHandler
Inherited fromβ
Defined inβ
onDayFocusβ
β’ Optional
onDayFocus: DayFocusEventHandler
Inherited fromβ
Defined inβ
onDayKeyDownβ
β’ Optional
onDayKeyDown: DayKeyboardEventHandler
Inherited fromβ
Defined inβ
onDayKeyPressβ
β’ Optional
onDayKeyPress: DayKeyboardEventHandler
Inherited fromβ
Defined inβ
onDayKeyUpβ
β’ Optional
onDayKeyUp: DayKeyboardEventHandler
Inherited fromβ
Defined inβ
onDayMouseEnterβ
β’ Optional
onDayMouseEnter: DayMouseEventHandler
Inherited fromβ
Defined inβ
onDayMouseLeaveβ
β’ Optional
onDayMouseLeave: DayMouseEventHandler
Inherited fromβ
Defined inβ
onDayTouchCancelβ
β’ Optional
onDayTouchCancel: DayTouchEventHandler
Inherited fromβ
DayPickerBase.onDayTouchCancel
Defined inβ
onDayTouchEndβ
β’ Optional
onDayTouchEnd: DayTouchEventHandler
Inherited fromβ
Defined inβ
onDayTouchMoveβ
β’ Optional
onDayTouchMove: DayTouchEventHandler
Inherited fromβ
Defined inβ
onDayTouchStartβ
β’ Optional
onDayTouchStart: DayTouchEventHandler
Inherited fromβ
Defined inβ
onMonthChangeβ
β’ Optional
onMonthChange: MonthChangeEventHandler
Event fired when the user navigates between months.
Inherited fromβ
Defined inβ
onNextClickβ
β’ Optional
onNextClick: MonthChangeEventHandler
Inherited fromβ
Defined inβ
onPrevClickβ
β’ Optional
onPrevClick: MonthChangeEventHandler
Inherited fromβ
Defined inβ
onSelectβ
β’ Optional
onSelect: SelectSingleEventHandler
Event fired when a day is selected.
Defined inβ
onWeekNumberClickβ
β’ Optional
onWeekNumberClick: WeekNumberClickEventHandler
Inherited fromβ
DayPickerBase.onWeekNumberClick
Defined inβ
pagedNavigationβ
β’ Optional
pagedNavigation: boolean
Paginate the month navigation displaying the numberOfMonths at time.
Inherited fromβ
Defined inβ
requiredβ
β’ Optional
required: boolean
Make the selection required.
Defined inβ
reverseMonthsβ
β’ Optional
reverseMonths: boolean
Render the months in reversed order (when numberOfMonths is greater
than 1
) to display the most recent month first.
Inherited fromβ
Defined inβ
selectedβ
β’ Optional
selected: Date
The selected day.
Overridesβ
Defined inβ
showOutsideDaysβ
β’ Optional
showOutsideDays: boolean
Show the outside days. An outside day is a day falling in the next or the
previous month. Default is false
.
Inherited fromβ
Defined inβ
showWeekNumberβ
β’ Optional
showWeekNumber: boolean
Show the week numbers column. Default to false
.
Inherited fromβ
Defined inβ
styleβ
β’ Optional
style: CSSProperties
Style to apply to the container element.
Inherited fromβ
Defined inβ
stylesβ
β’ Optional
styles: Partial
<Omit
<StyledElement
<CSSProperties
>, InternalModifiersElement
>>
Change the inline styles for each UIElement.
Inherited fromβ
Defined inβ
toDateβ
β’ Optional
toDate: Date
The latest day to end the month navigation.
Inherited fromβ
Defined inβ
toMonthβ
β’ Optional
toMonth: Date
The latest month to end the month navigation.
Inherited fromβ
Defined inβ
toYearβ
β’ Optional
toYear: number
The latest year to end the month navigation.
Inherited fromβ
Defined inβ
todayβ
β’ Optional
today: Date
The todayβs date. Default is the current date. This Date will get the
today
modifier to style the day.
Inherited fromβ
Defined inβ
weekStartsOnβ
β’ Optional
weekStartsOn: 0
| 1
| 2
| 3
| 4
| 5
| 6
The index of the first day of the week (0 - Sunday). Overrides the locale's one.