use-date-input - Build Your Own Date Picker
Getting StartedGetting StartedCalendar ExampleInput & Calendar ExampleStateThemingCompositionDate FrameworksLocalization
Components
Hooks
AnimatedGroupAnimatedMonthGroupCalendarCalendarProviderClickOutsideDayDayOfWeekHeaderHomeMonthMonthGroupPopperRootWeekWeekHeaderuseCalendarDispatchuseCalendarPropsuseCalendarStateuseDateAPIuseDateInputuseDateRangeInput

Getting Started

A Date Picker can consist of an input and a Calendar or just a Calendar.
use-date-input uses an adapter API so that it can be used with any date framework.
use-date-input provides pre-made adapters for the most popular frameworks or you can write your own.

  • date-fns
  • dayjs
  • luxon
  • moment

For date-fns users

yarn add date-fns
yarn add @use-date-input/core
yarn add @use-date-input/date-fns-adapter
yarn add styled-components

For dayjs users

yarn add dayjs
yarn add @use-date-input/core
yarn add @use-date-input/dayjs-adapter
yarn add styled-components

For luxon users

yarn add luxon
yarn add @use-date-input/core
yarn add @use-date-input/luxon-adapter
yarn add styled-components

For moment users

yarn add moment
yarn add @use-date-input/core
yarn add @use-date-input/moment-adapter
yarn add styled-components

Calendar Example

A basic example of the Calendar component.

2021
June
Su
Mo
Tu
We
Th
Fr
Sa
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

Input & Calendar Example

A basic example of the useDateInput hook, linking an HTML input and the Calendar component.

2021
June
Su
Mo
Tu
We
Th
Fr
Sa
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910