# react-horizontal-datepicker

> A simple and lightweight easily style-able Side scrolling datepicker, built with ❤️

Latest version **2.0.3** (published 2020-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-horizontal-datepicker
pnpm add react-horizontal-datepicker
yarn add react-horizontal-datepicker
bun add react-horizontal-datepicker
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2020-06-08 |
| First published | 2020-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Kushagra Agrawal |
| Maintainers | _kushagra |
| Keywords | date-picker, horizontal-calendar, horizontal-datepicker, swipeable, side-scrolling, calendar-strip, web |

## Links

- npm: https://www.npmjs.com/package/react-horizontal-datepicker
- Repository: https://github.com/kush-agra/react-horizontal-datepicker
- Issues: https://github.com/kush-agra/react-horizontal-datepicker/issues
- npm.io page: https://npm.io/package/react-horizontal-datepicker

## Dependencies (1)

- [date-fns](https://npm.io/package/date-fns.md) ^2.14.0

## Alternatives

- [@js-joda/timezone](https://npm.io/package/@js-joda/timezone.md) — 383.4K weekly downloads
- [chartjs-adapter-moment](https://npm.io/package/chartjs-adapter-moment.md) — 210.8K weekly downloads
- [strftime](https://npm.io/package/strftime.md) — 171.2K weekly downloads
- [vue-flatpickr-component](https://npm.io/package/vue-flatpickr-component.md) — 115.8K weekly downloads
- [timepicker](https://npm.io/package/timepicker.md) — 51.0K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2020-06-08
- 2.0.2 — 2020-04-04
- 2.0.1 — 2020-04-04
- 2.0.0 — 2020-04-04
- 0.1.11 — 2020-01-28
- 0.1.10 — 2020-01-09
- 0.1.9 — 2020-01-09
- 0.1.8 — 2020-01-07
- 0.1.7 — 2020-01-05
- 0.1.6 — 2020-01-03
- 0.1.5 — 2020-01-03
- 0.1.4 — 2020-01-03
- 0.1.3 — 2020-01-03
- 0.1.2 — 2020-01-03
- 0.1.1 — 2020-01-03
- … 1 more at https://npm.io/package/react-horizontal-datepicker/versions

## README

## react-horizontal-datepicker
#### V2 with new logic and completely removing dependency on react-waypoint as well as leaner code which now uses css-modules

A simple and lightweight easily style-able Side scrolling datepicker, built with ❤️

Bundle size of 469 Bytes Minified + Gzipped

![](https://user-images.githubusercontent.com/8018852/78461316-7faf3a80-76e5-11ea-919d-cbf600f29092.png) 

### Installation

Run `yarn add react-horizontal-datepicker`
or
Run `npm i react-horizontal-datepicker`

### Usage

Import:

`import DatePicker from "react-horizontal-datepicker";`

and simply use the component as:

```javascript
<DatePicker />
```

example at the end

#### Available Props are

| Prop          | Type    | Default  | Description |
| ------------- |:-------:| :-------:| ----------- |
| getSelectedDay  | Function |     | Function to get the selected Day |
| endDate         | Number|      90    | Number of days to render from current date |
| selectDate       | Date  |        | prop to send selected date manually or from another calendar component |
| color    | String    |    'rgb(54, 105, 238)'      | Set the primary color can be any color format in string |
| labelFormat | String | 'MMMM yyyy' | Month label format - uses [date-fns format](https://date-fns.org/v1.30.1/docs/format) types |

### Example:

https://codesandbox.io/s/vigilant-newton-gn0g7

```javascript
function App() {

    const selectedDay = (val) =>{
        console.log(val)
    };

  return (
      <DatePicker getSelectedDay={selectedDay}
                  endDate={100}
                  selectDate={new Date("2020-04-30")}
                  labelFormat={"MMMM"}
                  color={"#374e8c"}          
/>
  );
}
```

### Todo
use react window for efficiency

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