Interface: PropsBase
Defined in: src/types/props.ts:45
Props for customizing the calendar, handling localization, and managing events. These exclude the selection mode props.
See
https://daypicker.dev/api/interfaces/PropsBase
Properties
animate?
optional
animate:boolean
Defined in: src/types/props.ts:268
Animate navigating between months.
Since
9.6.0
See
https://daypicker.dev/docs/navigation#animate
aria-label?
optional
aria-label:string
Defined in: src/types/props.ts:389
The aria-label attribute to add to the container element.
Since
9.4.1
See
https://daypicker.dev/guides/accessibility
autoFocus?
optional
autoFocus:boolean
Defined in: src/types/props.ts:322
When a selection mode is set, DayPicker will focus the first selected day (if set) or today's date (if not disabled).
Use this prop when you need to focus DayPicker after a user action, for improved accessibility.
See
https://daypicker.dev/guides/accessibility#autofocus
broadcastCalendar?
optional
broadcastCalendar:boolean
Defined in: src/types/props.ts:278
Display the weeks in the month following the broadcast calendar. Setting this prop will ignore weekStartsOn (always Monday) and showOutsideDays will default to true.
Since
9.4.0
See
- https://daypicker.dev/docs/localization#broadcast-calendar
- https://en.wikipedia.org/wiki/Broadcast_calendar
captionLayout?
optional
captionLayout:"dropdown"
|"label"
|"dropdown-months"
|"dropdown-years"
Defined in: src/types/props.ts:217
Show dropdowns to navigate between months or years.
label
: Displays the month and year as a label. Default value.dropdown
: Displays dropdowns for both month and year navigation.dropdown-months
: Displays a dropdown only for the month navigation.dropdown-years
: Displays a dropdown only for the year navigation.
Note: By default, showing the dropdown will set the startMonth
to 100 years ago and endMonth to the end of the current year. You
can override this behavior by explicitly setting startMonth
and
endMonth
.
See
https://daypicker.dev/docs/customization#caption-layouts
className?
optional
className:string
Defined in: src/types/props.ts:60
Class name to add to the root element.
classNames?
optional
classNames:Partial
<ClassNames
> &Partial
<DeprecatedUI
<string
>>
Defined in: src/types/props.ts:70
Change the class names used by DayPicker.
Use this prop when you need to change the default class names — for example, when importing the style via CSS modules or when using a CSS framework.
See
https://daypicker.dev/docs/styling
components?
optional
components:Partial
<CustomComponents
>
Defined in: src/types/props.ts:303
Change the components used for rendering the calendar elements.
See
https://daypicker.dev/guides/custom-components
dateLib?
optional
dateLib:Partial
<DateLib
>
Defined in: src/types/props.ts:516
Experimental
Replace the default date library with a custom one. Experimental: not guaranteed to be stable (may not respect semver).
Since
9.0.0
defaultMonth?
optional
defaultMonth:Date
Defined in: src/types/props.ts:102
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 month and onMonthChange.
Default Value
The current month
See
https://daypicker.dev/docs/navigation
dir?
optional
dir:string
Defined in: src/types/props.ts:382
The text direction of the calendar. Use ltr
for left-to-right (default)
or rtl
for right-to-left.
See
https://daypicker.dev/docs/translation#rtl-text-direction
disabled?
Defined in: src/types/props.ts:334
Apply the disabled
modifier to the matching days. Disabled days cannot be
selected when in a selection mode is set.
See
https://daypicker.dev/docs/selection-modes#disabled
disableNavigation?
optional
disableNavigation:boolean
Defined in: src/types/props.ts:201
Disable the navigation between months. This prop won't hide the navigation: to hide the navigation, use hideNavigation.
See
https://daypicker.dev/docs/navigation#disablenavigation
endMonth?
optional
endMonth:Date
Defined in: src/types/props.ts:153
The latest month to end the month navigation.
Since
9.0.0
See
https://daypicker.dev/docs/navigation#start-and-end-dates
firstWeekContainsDate?
optional
firstWeekContainsDate:4
|1
Defined in: src/types/props.ts:451
The day of January that is always in the first week of the year.
See
https://daypicker.dev/docs/localization#first-week-contains-date
fixedWeeks?
optional
fixedWeeks:boolean
Defined in: src/types/props.ts:239
Display always 6 weeks per each month, regardless of the month’s number of weeks. Weeks will be filled with the days from the next month.
See
https://daypicker.dev/docs/customization#fixed-weeks
footer?
optional
footer:ReactNode
Defined in: src/types/props.ts:312
Add a footer to the calendar, acting as a live region.
Use this prop to communicate the calendar's status to screen readers. Prefer strings over complex UI elements.
See
https://daypicker.dev/guides/accessibility#footer
formatters?
optional
formatters:Partial
<Formatters
>
Defined in: src/types/props.ts:375
Formatters used to format dates to strings. Use this prop to override the default functions.
See
https://daypicker.dev/docs/translation#custom-formatters
hidden?
Defined in: src/types/props.ts:341
Apply the hidden
modifier to the matching days. Will hide them from the
calendar.
See
https://daypicker.dev/guides/custom-modifiers#hidden-modifier
hideNavigation?
optional
hideNavigation:boolean
Defined in: src/types/props.ts:194
Hide the navigation buttons. This prop won't disable the navigation: to disable the navigation, use disableNavigation.
Since
9.0.0
See
https://daypicker.dev/docs/navigation#hidenavigation
hideWeekdays?
optional
hideWeekdays:boolean
Defined in: src/types/props.ts:245
Hide the row displaying the weekday row header.
Since
9.0.0
id?
optional
id:string
Defined in: src/types/props.ts:92
A unique id to add to the root element.
ISOWeek?
optional
ISOWeek:boolean
Defined in: src/types/props.ts:286
Use ISO week dates instead of the locale setting. Setting this prop will
ignore weekStartsOn
and firstWeekContainsDate
.
See
labels?
optional
labels:Partial
<Labels
>
Defined in: src/types/props.ts:368
Labels creators to override the defaults. Use this prop to customize the aria-label attributes in DayPicker.
See
https://daypicker.dev/docs/translation#aria-labels
lang?
optional
lang:string
Defined in: src/types/props.ts:405
Add the language tag to the container element.
locale?
optional
locale:Partial
<Locale
>
Defined in: src/types/props.ts:418
The locale object used to localize dates. Pass a locale from
react-day-picker/locale
to localize the calendar.
Example
import { es } from "react-day-picker/locale";
<DayPicker locale={es} />
Default Value
enUS - The English locale default of date-fns
.
See
- https://daypicker.dev/docs/localization
- https://github.com/date-fns/date-fns/tree/main/src/locale for a list of the supported locales
mode?
optional
mode:Mode
Defined in: src/types/props.ts:51
Enable the selection of a single day, multiple days, or a range of days.
See
https://daypicker.dev/docs/selection-modes
modifiers?
optional
modifiers:Record
<string
,undefined
|Matcher
|Matcher
[]>
Defined in: src/types/props.ts:361
Add modifiers to the matching days.
Example
const modifiers = {
weekend: { dayOfWeek: [0, 6] }, // Match weekends
holiday: [new Date(2023, 11, 25)] // Match Christmas
};
<DayPicker modifiers={modifiers} />
See
https://daypicker.dev/guides/custom-modifiers
modifiersClassNames?
optional
modifiersClassNames:ModifiersClassNames
Defined in: src/types/props.ts:76
Change the class name for the day matching the modifiers
.
See
https://daypicker.dev/guides/custom-modifiers
modifiersStyles?
optional
modifiersStyles:ModifiersStyles
Defined in: src/types/props.ts:90
Change the class name for the day matching the modifiers.
See
https://daypicker.dev/guides/custom-modifiers
month?
optional
month:Date
Defined in: src/types/props.ts:111
The month displayed in the calendar.
As opposed to defaultMonth
, use this prop with onMonthChange
to change
the month programmatically.
See
https://daypicker.dev/docs/navigation
navLayout?
optional
navLayout:"around"
|"after"
Defined in: src/types/props.ts:232
Adjust the positioning of the navigation buttons.
around
: Displays the buttons on either side of the caption.after
: Displays the buttons after the caption. This ensures the tab order matches the visual order.
If not set, the buttons default to being displayed after the caption, but the tab order may not align with the visual order.
Since
9.7.0
See
https://daypicker.dev/docs/customization#navigation-layouts
nonce?
optional
nonce:string
Defined in: src/types/props.ts:401
A cryptographic nonce ("number used once") which can be used by Content
Security Policy for the inline style
attributes.
numberOfMonths?
optional
numberOfMonths:number
Defined in: src/types/props.ts:118
The number of displayed months.
Default Value
1
See
https://daypicker.dev/docs/customization#multiplemonths
numerals?
optional
numerals:Numerals
Defined in: src/types/props.ts:438
The numeral system to use when formatting dates.
latn
: Latin (Western Arabic)arab
: Arabic-Indicarabext
: Eastern Arabic-Indic (Persian)deva
: Devanagaribeng
: Bengaliguru
: Gurmukhigujr
: Gujaratiorya
: Oriyatamldec
: Tamiltelu
: Teluguknda
: Kannadamlym
: Malayalam
Default Value
latn
Latin (Western Arabic)
See
https://daypicker.dev/docs/translation#numeral-systems
onDayBlur?
optional
onDayBlur:DayEventHandler
<FocusEvent
<Element
,Element
>>
Defined in: src/types/props.ts:501
Event handler when a day is blurred.
onDayClick?
optional
onDayClick:DayEventHandler
<MouseEvent
<Element
,MouseEvent
>>
Defined in: src/types/props.ts:497
Event handler when a day is clicked.
onDayFocus?
optional
onDayFocus:DayEventHandler
<FocusEvent
<Element
,Element
>>
Defined in: src/types/props.ts:499
Event handler when a day is focused.
onDayKeyDown?
optional
onDayKeyDown:DayEventHandler
<KeyboardEvent
<Element
>>
Defined in: src/types/props.ts:503
Event handler when a key is pressed on a day.
onDayMouseEnter?
optional
onDayMouseEnter:DayEventHandler
<MouseEvent
<Element
,MouseEvent
>>
Defined in: src/types/props.ts:505
Event handler when the mouse enters a day.
onDayMouseLeave?
optional
onDayMouseLeave:DayEventHandler
<MouseEvent
<Element
,MouseEvent
>>
Defined in: src/types/props.ts:507
Event handler when the mouse leaves a day.
onMonthChange?
optional
onMonthChange:MonthChangeEventHandler
Defined in: src/types/props.ts:472
Event fired when the user navigates between months.
See
https://daypicker.dev/docs/navigation#onmonthchange
onNextClick?
optional
onNextClick:MonthChangeEventHandler
Defined in: src/types/props.ts:479
Event handler when the next month button is clicked.
See
https://daypicker.dev/docs/navigation
onPrevClick?
optional
onPrevClick:MonthChangeEventHandler
Defined in: src/types/props.ts:485
Event handler when the previous month button is clicked.
See
https://daypicker.dev/docs/navigation
pagedNavigation?
optional
pagedNavigation:boolean
Defined in: src/types/props.ts:179
Paginate the month navigation displaying the numberOfMonths
at a time.
See
https://daypicker.dev/docs/customization#multiplemonths
required?
optional
required:boolean
Defined in: src/types/props.ts:57
Whether the selection is required.
See
https://daypicker.dev/docs/selection-modes
reverseMonths?
optional
reverseMonths:boolean
Defined in: src/types/props.ts:186
Render the months in reversed order (when numberOfMonths is set) to display the most recent month first.
See
https://daypicker.dev/docs/customization#multiplemonths
role?
optional
role:"application"
|"dialog"
Defined in: src/types/props.ts:396
The role attribute to add to the container element.
Since
9.4.1
See
https://daypicker.dev/guides/accessibility
showOutsideDays?
optional
showOutsideDays:boolean
Defined in: src/types/props.ts:254
Show the outside days (days falling in the next or the previous month).
Note: when a broadcastCalendar is set, this prop defaults to true.
See
https://daypicker.dev/docs/customization#outside-days
showWeekNumber?
optional
showWeekNumber:boolean
Defined in: src/types/props.ts:261
Show the week numbers column. Weeks are numbered according to the local week index.
See
https://daypicker.dev/docs/customization#showweeknumber
startMonth?
optional
startMonth:Date
Defined in: src/types/props.ts:125
The earliest month to start the month navigation.
Since
9.0.0
See
https://daypicker.dev/docs/navigation#start-and-end-dates
style?
optional
style:CSSProperties
Defined in: src/types/props.ts:78
Style to apply to the root element.
styles?
optional
styles:Partial
<Styles
> &Partial
<DeprecatedUI
<CSSProperties
>>
Defined in: src/types/props.ts:84
Change the inline styles of the HTML elements.
See
https://daypicker.dev/docs/styling
timeZone?
optional
timeZone:string
Defined in: src/types/props.ts:297
The time zone (IANA or UTC offset) to use in the calendar (experimental).
See Wikipedia for the possible values.
Since
9.1.1
See
https://daypicker.dev/docs/time-zone
title?
optional
title:string
Defined in: src/types/props.ts:403
Add a title
attribute to the container element.
today?
optional
today:Date
Defined in: src/types/props.ts:348
The today’s date. Default is the current date. This date will get the
today
modifier to style the day.
See
https://daypicker.dev/guides/custom-modifiers#today-modifier
useAdditionalDayOfYearTokens?
optional
useAdditionalDayOfYearTokens:boolean
Defined in: src/types/props.ts:465
Enable YY
and YYYY
for day of year tokens when formatting or parsing
dates.
See
https://date-fns.org/docs/Unicode-Tokens
useAdditionalWeekYearTokens?
optional
useAdditionalWeekYearTokens:boolean
Defined in: src/types/props.ts:458
Enable DD
and DDDD
for week year tokens when formatting or parsing
dates.
See
https://date-fns.org/docs/Unicode-Tokens
weekStartsOn?
optional
weekStartsOn:0
|5
|4
|1
|6
|2
|3
Defined in: src/types/props.ts:445
The index of the first day of the week (0 - Sunday). Overrides the locale's default.
See
https://daypicker.dev/docs/localization#first-date-of-the-week