1.1.1 • Published 3 years ago

@billogram/use-datepicker v1.1.1

Weekly downloads
6
License
MIT
Repository
-
Last release
3 years ago

@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