@billogram/use-datepicker
v1.1.1
Published
> A React hook for datepicker components
Downloads
5
Keywords
Readme
@billogram/use-datepicker
A React hook for datepicker components
Install
yarn add @billogram/use-datepicker
Usage
import useDatepicker from '@billogram/use-datepicker';
See types for exported types.
useDatepicker
It is important that implemented datepickers conform with WAI-ARIA best practices.
const {
change,
close,
currentHighlightedDate,
currentMonth,
currentYear,
expanded,
handleKeyDown,
moveToNextMonth,
moveToNextYear,
moveToPreviousMonth,
moveToPreviousYear,
open,
prevExpanded,
toggle,
weekdays,
weeks,
} = useDatepicker({
disabled: false,
isExpandedInitial: false,
onChange: noop,
shouldDisableDate: never,
value: null,
});
Note
This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.
License
MIT