A date picker component for React
- Keyboard accessibility support
npm install --save reactanggal
import React, { useState } from 'react'
import Reactanggal from 'reactanggal'
import 'reactanggal/dist/reactanggal.css'
const App = () => {
const [date, setDate] = useState(new Date())
return (
<Reactanggal
selected={date}
onChange={setDate}
/>
)
}
Key | Default Value | Type | Description |
---|---|---|---|
selected |
undefined |
Date / null / undefined |
Selected date value |
onChange |
undefined |
function |
Handle date changes |
minDate |
undefined |
Date / null / undefined |
Set minimum date to select & disable earlier dates |
maxDate |
undefined |
Date / null / undefined |
Set maximum date to select & disable later dates |
showOutsideMonth |
false |
boolean |
Show or hide dates that fall outside the current month |
MIT © andarasophan