You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calendar component provides a way to select a date while allowing you to style
them however. All the date, month & year calculations are done internally using
@internationalized/date
to provide the ease of use. It follows the
Grid Pattern for the keyboard
navigaiton & focus management. Supports all the features as React Aria's
useCalendar.
The locale to display and edit the value according to.
createCalendar
(name: string) => Calendar
A function that creates a Calendarobject for a given calendar identifier. Such a function may be imported from the@internationalized/date package, or manually implemented to include support foronly certain calendars.
CalendarStateProps props
> These props are returned by the other props You can also provide these props.
Name
Type
Description
visibleDuration
DateDuration | undefined
The amount of days that will be displayed at once. This affects how pagination works.
selectionAlignment
"start" | "center" | "end" | undefined
Determines how to align the initial selection relative to the visible date range.
minValue
DateValue | undefined
The minimum allowed date that a user may select.
maxValue
DateValue | undefined
The maximum allowed date that a user may select.
isDateUnavailable
((date: DateValue) => boolean) | undefined
Callback that is called for each date of the calendar. If it returns true, then the date is unavailable.
isDisabled
boolean | undefined
Whether the calendar is disabled.
isReadOnly
boolean | undefined
Whether the calendar value is immutable.
autoFocus
boolean | undefined
Whether to automatically focus the calendar when it mounts.
focusedValue
DateValue | undefined
Controls the currently focused date within the calendar.
defaultFocusedValue
DateValue | undefined
The date that is focused when the calendar first mounts (uncountrolled).
onFocusChange
((date: CalendarDate) => void) | undefined
Handler that is called when the focused date changes.
validationState
ValidationState | undefined
Whether the current selection is valid or invalid according to application logic.
errorMessage
ReactNode
An error message to display when the selected value is invalid.
value
T | undefined
The current value (controlled).
defaultValue
T | undefined
The default value (uncontrolled).
onChange
((value: C) => void) | undefined
Handler that is called when the value changes.
CalendarCellOptions
Name
Type
Description
state
CalendarCellState
Object returned by the useCalendarCellState hook.
CalendarCellButtonOptions
Name
Type
Description
state
CalendarCellState
Object returned by the useCalendarCellState hook.
CalendarCellStateProps
Name
Type
Description
date
CalendarDate
The date that this cell represents.
state
CalendarState | RangeCalendarState
Object returned by the useCalendarBaseState & RangeCalendarBaseState hook.
CalendarGridOptions
Name
Type
Description
state
CalendarGridAria
Object returned by the useCalendarGridState hook.
CalendarGridStateProps
Name
Type
Description
startDate
CalendarDate | undefined
The first date displayed in the calendar grid.Defaults to the first visible date in the calendar.Override this to display multiple date grids in a calendar.
endDate
CalendarDate | undefined
The last date displayed in the calendar grid.Defaults to the last visible date in the calendar.Override this to display multiple date grids in a calendar.
state
CalendarState | RangeCalendarState
Object returned by the useCalendarBaseState & RangeCalendarBaseState hook.
CalendarNextButtonOptions
Name
Type
Description
state
CalendarAria | RangeCalendarState
Object returned by the useCalendarState & RangeCalendarState hook.
CalendarPreviousButtonOptions
Name
Type
Description
state
CalendarAria | RangeCalendarState
Object returned by the useCalendarState & RangeCalendarState hook.