# @wh.knightz/react-datepicker

> A simple and reusable datepicker component for React

Latest version **1.0.2** (published 2021-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wh.knightz/react-datepicker
pnpm add @wh.knightz/react-datepicker
yarn add @wh.knightz/react-datepicker
bun add @wh.knightz/react-datepicker
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-06-30 |
| First published | 2021-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 700.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wh.knightz |
| Maintainers | wh.knightz |
| Keywords | react, datepicker, calendar, date, react-component |

## Links

- npm: https://www.npmjs.com/package/@wh.knightz/react-datepicker
- Repository: https://github.com/WHKnightZ/react-datepicker
- Issues: https://github.com/WHKnightZ/react-datepicker/issues
- npm.io page: https://npm.io/package/@wh.knightz/react-datepicker

## Dependencies (6)

- [date-fns](https://npm.io/package/date-fns.md) ^2.0.1
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [react-popper](https://npm.io/package/react-popper.md) ^2.2.5
- [@popperjs/core](https://npm.io/package/@popperjs/core.md) ^2.9.2
- [react-onclickoutside](https://npm.io/package/react-onclickoutside.md) ^6.10.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2021-06-30
- 1.0.1 — 2021-06-22
- 1.0.0 — 2021-06-22

## README

# React Date Picker

Forked from https://github.com/Hacker0x01/react-datepicker

Add feature: When user open the years dropdown, auto scroll to selected year

## Installation

The package can be installed via [npm](https://github.com/npm/cli):

```
npm install @whknightz/react-datepicker --save
```

Or via [yarn](https://github.com/yarnpkg/yarn):

```
yarn add @whknightz/react-datepicker
```

```js
import React, { useState } from 'react';
import DatePicker from '@whknightz/react-datepicker';

import '@whknightz/react-datepicker/dist/react-datepicker.css';

const Example = () => {
  const [startDate, setStartDate] = useState(new Date());
  return (
    <DatePicker
      selected={startDate}
      onChange={(date) => setStartDate(date)}
      yearDropdownItemNumber={40}
      showYearDropdown
      showMonthDropdown
      scrollableYearDropdown
      adjustDateOnChange
    />
  );
};
```

## License

Copyright (c) 2014-2021 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.

---
_Source: https://npm.io/package/@wh.knightz/react-datepicker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
