# react-styled-component-calendar

> ## Installation

Latest version **1.4.0** (published 2020-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-styled-component-calendar
pnpm add react-styled-component-calendar
yarn add react-styled-component-calendar
bun add react-styled-component-calendar
```

## 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.4.0 |
| Published | 2020-05-15 |
| First published | 2020-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 659.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | alex-windett |

## Links

- npm: https://www.npmjs.com/package/react-styled-component-calendar
- npm.io page: https://npm.io/package/react-styled-component-calendar

## Dependencies (9)

- [luxon](https://npm.io/package/luxon.md) ^1.22.0
- [moment](https://npm.io/package/moment.md) ^2.24.0
- [date-fns](https://npm.io/package/date-fns.md) ^2.10.0
- [typescript](https://npm.io/package/typescript.md) ^3.8.3
- [react-scripts](https://npm.io/package/react-scripts.md) 3.4.0
- [styled-components](https://npm.io/package/styled-components.md) ^5.0.1
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^9.3.2
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^4.2.4
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^7.1.2

## Recent versions

- 1.4.0 (latest) — 2020-05-15
- 1.2.0 — 2020-05-15
- 1.0.19-alpha — 2020-05-15
- 1.0.18-alpha — 2020-05-14
- 1.0.16-alpha — 2020-03-09
- 1.0.15-alpha — 2020-03-09
- 1.0.14-alpha — 2020-03-09
- 1.0.10-alpha — 2020-03-05
- 1.0.9-alpha — 2020-03-05
- 1.0.8-alpha — 2020-03-04
- 1.0.7-alpha — 2020-03-04
- 1.0.5-alpha — 2020-03-03
- 1.0.4-alpha — 2020-03-03

## README

# React Styled Component Calendar

## Installation

```bash
yarn add react-styled-component-calendar
```

or

```bash
npm install --save react-styled-component-calendar
```

## Usage

```js
import Calendar from 'react-styled-component-calendar'

const events = [{
    "title": "Two Volcano Sprint",
    "startDate": "2020-10-18T05:30+01:00",
    "endDate": "2020-10-24T00:00+00:00"
  }, {
    "title": "Silk Road Mountain Race",
    "startDate": "2020-08-14T00:00+00:00",
    "endDate": "2020-08-21T00:00+00:00"
  }, {
    "title": "Transcontinental No.8",
    "startDate": "2020-07-25T00:00+00:00",
    "endDate": "2020-08-01T00:00+00:00"
  }, {
    "title": "TransIbérica",
    "startDate": "2020-07-12T22:00+01:00",
    "endDate": "2020-07-26T22:00+01:00"
  }, {
    "title": "Transpyrenees",
    "startDate": "2020-06-27T21:00+01:00",
		"endDate": "2020-07-03T21:00+01:00"
	}, {
    "title": "GBDURO20",
    "startDate": "2020-06-27T08:00+00:00",
    "endDate": "2020-07-04T00:00+00:00"
  }, {
    "title": "Tour Divide",
    "startDate": "2020-06-12T08:00-07:00",
    "endDate": "2020-07-10T00:00+00:00"
  }, {
    "title": "Trans America Bike Race",
    "startDate": "2020-06-07T06:00-08:00",
		"endDate": "2020-06-20T18:00-05:00"
	}
}]

<Calendar events={events}>
```

### Props

| **prop**                       | **type** | **required** | **description**                                                                                                                                                |
| ------------------------------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| events                         | array    | \*           | array of events to pass to the calendar, so below for format of event                                                                                          |
| dateInView                     | string   |              | the current date to be displayed. JavaScript new Date() object. n.b month index starts at 0                                                                    |
| navMonthFormat                 | string   |              | moment js month format                                                                                                                                         |
| navYearsBeforeNow              | number   |              | number of years to show before current year                                                                                                                    |
| navYearsAfterNow               | number   |              | number of years to show before current year                                                                                                                    |
| outOfMonthCalendarDayHighlight | string   |              | cell hightlight for days outside of visible month                                                                                                              |
| todayColorHightight            | string   |              | cell highlight for today                                                                                                                                       |
| onPrevMonthClick               | function |              | (month: number) => {} A function that is fired after month change containing the new month                                                                     |
| onNextMonthClick               | function |              | (month: number) => {} A function that is fired after month change containing the new month                                                                     |
| CalendarCellRenderer           | function |              | ({ index: number, events:Event[] }): React.FC<{}> => null; Full override function that returns a Calendar Cell Component. All other Cell props will be ignored |
| MonthNavRenderer               | function |              | (): React.FC<{}> => {} Function that returns the month nav component                                                                                           |
| WeekHeaderRenderer             | function |              | ({ days: string[] }}): React.FC<{}> => {} Function that returns the week nav component                                                                         |

### Event

| **attribute** | **required** | **type** | **description**                                                  |
| ------------- | ------------ | -------- | ---------------------------------------------------------------- |
| title         | \*           | string   | Title to render for given range                                  |
| startDate     | \*           | DateTime | start date                                                       |
| endDate       | \*           | DateTime |
| ...props      |              | any      | any other values you would like to use in a custom calender cell |

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