1.1.1 • Published 4 years ago

react-primitive-datepicker v1.1.1

Weekly downloads
6
License
ISC
Repository
github
Last release
4 years ago

React primitive date picker

Simplest datepicker possible with modest amount of features and native behaviour on mobile devices. Easily customizable.

Here's DEMO!

Components props

NameTypeDefault valueDescription
valueDaten/aJavascript date object that will be date picker value
onChangeFunctionn/aChange handler that expects date object
placeholderStringn/aInput placeholder
localeStringenUSLocale that will be mapped in date-ins locale and used for date formatting and translations. List of all available locales.
customClassNamesObjectn/aObject with classes that you can use to customize the element. List of properties you can find below.
customElementsObjectn/aList of classes that you can use to customize the element. List of properties you can find below.

customClassNames object

NameTypeDescription
wrapperStringGeneral wrapper of all elements. A good place to pass your custom font or adjust text color of all elements.
dropdownWrapperStringWrapper of date picker dropdown where you can stylize
inputStringInput class.
inputFocusedStringInput class when it's focused.
placeholderStringInput placeholder.
dateHeadingStringDate heading class in dropdown head between controls.
weekDayStringClass of shortened week days above calendar.
dateItemStringClass of every calendar item. You can adjust font-size of every element in here and dropdown will stretch accordingly.
dateItemSelectedStringClass of selected item.

customElements object

NameTypeDescription
decrementYearElement{ JSX element }First left dropdown head control.
decrementMonthElement{ JSX element }Second left dropdown head control.
incrementMonthElement{ JSX element }First right dropdown head control.
incrementYearElement{ JSX element }I Second right dropdown head control.