use-date-input - Build Your Own Date Picker
Getting StartedStateThemingCompositionDate FrameworksLocalization
Components
Hooks
AnimatedGroupAnimatedMonthGroupCalendarCalendarProviderClickOutsideDayExamplePropsImportingDayOfWeekHeaderHomeMonthMonthGroupPopperRootWeekWeekHeaderuseCalendarDispatchuseCalendarPropsuseCalendarStateuseDateAPIuseDateInputuseDateRangeInput

Day

The Day components renders a calendar day, based on the current Calendar state.

In the default implementation, Week is the parent of Day.

Example

15

Props

Prop NameTypeIs RequiredDefault ValueDescription
activeCursorstringoptionalActive cursor type, based on last user selection, defines any visible range
classNamestringoptionalClass name of root element
dayobjectoptionalDay object
disabledbooloptionalFlag indicating whether the day is disabled
isEndDatebooloptionalFlag indicating whether the date is the end date
isFocusedbooloptionalFlag indicating whether the day is focused
isKeyboardCursorbooloptionalFlag indicating whether the day is the keyboard cursor
isMidRangebooloptionalFlag indicating whether the date is between start and end of range
isMouseCursorbooloptionalFlag indicating whether the day is the mouse cursor
isMouseCursorValidbooloptionalFlag indicating whether the mouse cursor defines a valid range
isOutsideOfMonthbooloptionalIs outside of the current month that is being rendered
isStartDatebooloptionalFlag indicating whether the date is the start date
isTodaybooloptionalFlag indicating whether the date is today
onMouseOutDatefuncoptionalCallback called when mouse leaves a Day
onMouseOverDatefuncoptionalCallback called when mouse is over a Day
onSelectDatefuncoptionalCallback called on date select
tabIndexnumberoptionalThe tab index
toFormattedDatefuncrequiredCallback to format a date, used by aria labels

Importing

It can be imported as either the base component

import { Day } from "@use-date-input/core";

or as an overridable component that can be replaced through the components prop in CalendarProvider.
Refer to How to replace UI components.

import { CustomisableDay } from "@use-date-input/core";

If providing your own component, it can be useful to import the base component and use it within your composition.