Interface: DayPickerBase
The base props for the DayPicker component and the DayPickerContext.
Extended byβ
DayPickerContextValue
DayPickerDefaultProps
DayPickerMultipleProps
DayPickerRangeProps
DayPickerSingleProps
Propertiesβ
ISOWeek?β
optional
ISOWeek:boolean
Use ISO week dates instead of the locale setting. Setting this prop will ignore weekStartsOn and firstWeekContainsDate.
Seeβ
https://en.wikipedia.org/wiki/ISO_week_date
Sourceβ
src/types/DayPickerBase.ts:200
captionLayout?β
optional
captionLayout:CaptionLayout
Change the layout of the caption:
buttons
: 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.
Default Valueβ
buttons
Sourceβ
src/types/DayPickerBase.ts:145
className?β
optional
className:string
The CSS class to add to the container element. To change the name of the
class instead, use classNames.root
.
Sourceβ
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.
Sourceβ
components?β
optional
components:CustomComponents
Map of components used to create the layout. Look at the components source to understand how internal components are built and provide your custom components.
Sourceβ
src/types/DayPickerBase.ts:208
defaultMonth?β
optional
defaultMonth:Date
The initial month to show in the calendar. Use this prop to let DayPicker control the current month. If you need to set the month programmatically, use []] and [onMonthChange.
Default Valueβ
The current month
Sourceβ
dir?β
optional
dir:string
The text direction of the calendar. Use ltr
for left-to-right (default)
or rtl
for right-to-left.
Sourceβ
src/types/DayPickerBase.ts:264
disableNavigation?β
optional
disableNavigation:boolean
Disable the navigation between months.
Default Valueβ
false
Sourceβ
src/types/DayPickerBase.ts:119
disabled?β
Apply the disabled
modifier to the matching days.
Sourceβ
src/types/DayPickerBase.ts:223
firstWeekContainsDate?β
optional
firstWeekContainsDate:1
|4
The day of January, which is always in the first week of the year. Can be
either Monday (1
) or Thursday (4
).
Seeβ
Sourceβ
src/types/DayPickerBase.ts:193
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 Valueβ
false
Sourceβ
src/types/DayPickerBase.ts:152
footer?β
optional
footer:ReactNode
Content to add to the table footer element.
Sourceβ
src/types/DayPickerBase.ts:211
formatters?β
optional
formatters:Partial
<Formatters
>
A map of formatters. Use the formatters to override the default formatting functions.
Sourceβ
src/types/DayPickerBase.ts:258
fromDate?β
optional
fromDate:Date
The earliest day to start the month navigation.
Sourceβ
src/types/DayPickerBase.ts:103
fromMonth?β
optional
fromMonth:Date
The earliest month to start the month navigation.
Sourceβ
src/types/DayPickerBase.ts:107
fromYear?β
optional
fromYear:number
The earliest year to start the month navigation.
Sourceβ
src/types/DayPickerBase.ts:111
hidden?β
Apply the hidden
modifier to the matching days. Will hide them from the
calendar.
Sourceβ
src/types/DayPickerBase.ts:228
hideHead?β
optional
hideHead:boolean
Hide the monthβs head displaying the weekday names.
Default Valueβ
false
Sourceβ
src/types/DayPickerBase.ts:158
id?β
optional
id:string
A unique id to replace the random generated id β used by DayPicker for accessibility.
Sourceβ
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.
Sourceβ
src/types/DayPickerBase.ts:220
labels?β
optional
labels:Partial
<Labels
>
Labels creators to override the defaults. Use this prop to customize the ARIA labels attributes.
Sourceβ
src/types/DayPickerBase.ts:252
lang?β
optional
lang:string
Add the language tag to the container element.
Sourceβ
src/types/DayPickerBase.ts:276
locale?β
optional
locale:Locale
The date-fns locale object used to localize dates.
Default Valueβ
en-US
Sourceβ
src/types/DayPickerBase.ts:246
modifiers?β
optional
modifiers:DayModifiers
Add modifiers to the matching days.
Sourceβ
src/types/DayPickerBase.ts:239
modifiersClassNames?β
optional
modifiersClassNames:ModifiersClassNames
Change the class name for the day matching the modifiers.
Sourceβ
modifiersStyles?β
optional
modifiersStyles:ModifiersStyles
Change the inline style for the day matching the modifiers.
Sourceβ
month?β
optional
month:Date
The month displayed in the calendar.
As opposed to DayPickerBase.defaultMonth, use this prop with DayPickerBase.onMonthChange to change the month programmatically.
Sourceβ
nonce?β
optional
nonce:string
A cryptographic nonce ("number used once") which can be used by Content
Security Policy for the inline style
attributes.
Sourceβ
src/types/DayPickerBase.ts:270
numberOfMonths?β
optional
numberOfMonths:number
The number of displayed months.
Default Valueβ
1
Sourceβ
src/types/DayPickerBase.ts:101
onDayBlur?β
optional
onDayBlur:DayFocusEventHandler
Event callback fired when the user blurs from a day.
Sourceβ
src/types/DayPickerBase.ts:293
onDayClick?β
optional
onDayClick:DayClickEventHandler
Event callback fired when the user clicks on a day.
Sourceβ
src/types/DayPickerBase.ts:289
onDayFocus?β
optional
onDayFocus:DayFocusEventHandler
Event callback fired when the user focuses on a day.
Sourceβ
src/types/DayPickerBase.ts:291
onDayKeyDown?β
optional
onDayKeyDown:DayKeyboardEventHandler
Event callback fired when the user presses a key on a day.
Sourceβ
src/types/DayPickerBase.ts:299
onDayKeyPress?β
optional
onDayKeyPress:DayKeyboardEventHandler
Event callback fired when the user presses a key on a day.
Sourceβ
src/types/DayPickerBase.ts:303
onDayKeyUp?β
optional
onDayKeyUp:DayKeyboardEventHandler
Event callback fired when the user presses a key on a day.
Sourceβ
src/types/DayPickerBase.ts:301
onDayMouseEnter?β
optional
onDayMouseEnter:DayMouseEventHandler
Event callback fired when the user hovers on a day.
Sourceβ
src/types/DayPickerBase.ts:295
onDayMouseLeave?β
optional
onDayMouseLeave:DayMouseEventHandler
Event callback fired when the user hovers away from a day.
Sourceβ
src/types/DayPickerBase.ts:297
onDayPointerEnter?β
optional
onDayPointerEnter:DayPointerEventHandler
Event callback fired when the pointer enters a day.
Sourceβ
src/types/DayPickerBase.ts:305
onDayPointerLeave?β
optional
onDayPointerLeave:DayPointerEventHandler
Event callback fired when the pointer leaves a day.
Sourceβ
src/types/DayPickerBase.ts:307
onDayTouchCancel?β
optional
onDayTouchCancel:DayTouchEventHandler
Event callback when a day touch event is canceled.
Sourceβ
src/types/DayPickerBase.ts:309
onDayTouchEnd?β
optional
onDayTouchEnd:DayTouchEventHandler
Event callback when a day touch event ends.
Sourceβ
src/types/DayPickerBase.ts:311
onDayTouchMove?β
optional
onDayTouchMove:DayTouchEventHandler
Event callback when a day touch event moves.
Sourceβ
src/types/DayPickerBase.ts:313
onDayTouchStart?β
optional
onDayTouchStart:DayTouchEventHandler
Event callback when a day touch event starts.
Sourceβ
src/types/DayPickerBase.ts:315
onMonthChange?β
optional
onMonthChange:MonthChangeEventHandler
Event fired when the user navigates between months.
Sourceβ
onNextClick?β
optional
onNextClick:MonthChangeEventHandler
Event callback fired when the next month button is clicked.
Sourceβ
src/types/DayPickerBase.ts:279
onPrevClick?β
optional
onPrevClick:MonthChangeEventHandler
Event callback fired when the previous month button is clicked.
Sourceβ
src/types/DayPickerBase.ts:281
onWeekNumberClick?β
optional
onWeekNumberClick:WeekNumberClickEventHandler
Event callback fired when the week number is clicked. Requires
showWeekNumbers
set.
Sourceβ
src/types/DayPickerBase.ts:286
pagedNavigation?β
optional
pagedNavigation:boolean
Paginate the month navigation displaying the numberOfMonths at time.
Default Valueβ
false
Sourceβ
src/types/DayPickerBase.ts:125
reverseMonths?β
optional
reverseMonths:boolean
Render the months in reversed order (when numberOfMonths is greater
than 1
) to display the most recent month first.
Default Valueβ
false
Sourceβ
src/types/DayPickerBase.ts:132
selected?β
Apply the selected
modifier to the matching days.
Sourceβ
src/types/DayPickerBase.ts:231
showOutsideDays?β
optional
showOutsideDays:boolean
Show the outside days. An outside day is a day falling in the next or the previous month.
Default Valueβ
false
Sourceβ
src/types/DayPickerBase.ts:165
showWeekNumber?β
optional
showWeekNumber:boolean
Show the week numbers column. Weeks are numbered according to the local week index.
- To use ISO week numbering, use the ISOWeek prop.
- To change how the week numbers are displayed, use the Formatters prop.
Default Valueβ
false
Seeβ
ISOWeek , weekStartsOn and firstWeekContainsDate.
Sourceβ
src/types/DayPickerBase.ts:177
style?β
optional
style:CSSProperties
Style to apply to the container element.
Sourceβ
styles?β
optional
styles:Partial
<Omit
<StyledElement
<CSSProperties
>,InternalModifiersElement
>>
Change the inline styles of the HTML elements.
Sourceβ
title?β
optional
title:string
Add a title
attribute to the container element.
Sourceβ
src/types/DayPickerBase.ts:273
toDate?β
optional
toDate:Date
The latest day to end the month navigation.
Sourceβ
src/types/DayPickerBase.ts:105
toMonth?β
optional
toMonth:Date
The latest month to end the month navigation.
Sourceβ
src/types/DayPickerBase.ts:109
toYear?β
optional
toYear:number
The latest year to end the month navigation.
Sourceβ
src/types/DayPickerBase.ts:113
today?β
optional
today:Date
The todayβs date. Default is the current date. This Date will get the
today
modifier to style the day.
Sourceβ
src/types/DayPickerBase.ts:237
weekStartsOn?β
optional
weekStartsOn:0
|2
|1
|3
|4
|5
|6
The index of the first day of the week (0 - Sunday). Overrides the locale's one.
Seeβ
ISOWeek .