1.0.1 • Published 3 years ago
ya-pickers v1.0.1
ya-pickers
Yet another picker library for React
Install
npm install clsx dayjs ya-pickers
or
yarn add clsx dayjs ya-pickers
Usage
import React, { Component } from 'react'
import DatePicker from 'ya-pickers'
import 'ya-pickers/dist/index.css'
const App = () => {
return (
<DatePicker
date={null} // initial date - string | Date
input = {(handle) => /** react element */ }
fullScreen={false} // full screen mode
blurBackdrop={false} // blur backdrop
backdropBlurPixel={1} // blur pixel
pickerOptions={{
width: 245, // picker UI width
weekDays: ['Sun', 'Mon', 'Thu', 'Wed', 'Tue', 'Fri', 'Sat'], // week days
format: {
heading: 'dddd, MMM DD, YYYY', // picker UI heading date display format
nav: 'MMM YYYY', // picker UI nav date display format
format: 'YYYY-MM-DD' // picker input/out date format
},
yearNavigationStep: 12, // year navigation step
icons: {
calendar: null // calendar icon react element
},
onChangeOnlyWhenDoubleClicked: true
}}
closeOnChange={true} // close when onChange is called
onChange={(selectedDate) => /** onChange handler*/ } />
)
}
License
MIT © chanyeinthaw