Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@billogram/use-datepicker

mrydengren11MITdeprecated1.1.1TypeScript support: included

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

A React hook for datepicker components

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