1.1.2 • Published 2 years ago

react-calendar-components v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-calendar-components

Library containing UI calendar components with devent display. (date w/range picker will be added in future versions)

Installation

  yarn add react-calendar-components

or

  npm i react-calendar-components

Usage/Examples

import React from 'react';
import { Calendar } from 'react-calendar-components';
 
const App = () => {
  return <Calendar />
};
 
export default App;

Calendar can be configured with inline props:

<Calendar 
    events={eventsArray}
    shadow={false}
    size="sm"
/>

If you want to include events - they have to be passed as array of objects according to scheme below:

Array<Event>

interface Event {
    id: string, 
    name: string, 
    date: string, 
    category?: string, 
    endDate?: string,
    hour?: string,
    endHour?: string,
    description?: string,
    type?: "primary" | "secondary",
    color?: `#${string}`,
}

License

MIT

Screenshots

Component Screenshot

Parameters

all parameters are optional

parametertypedefaultValuedescription
eventsArray<Event>[]For more type references see above
size"sm" \| "md" \| "lg""md"change calendar size
startDateDatenew Date()set the date that you want calendar to open (displayed month just after load)
shadowBooleantrueendable/disable shadow
roundedBooleanfalseendable/disable rounded corners
showEventsOnClickBooleanfalseenable/disable showing event info below calendar after date click (does not disable the onClickDate funtion)
labelColor#{string} - hex value"#009DFF"set color of main label (accent color seen on top bar and event indicators when event color is not defined)
bgColor#{string} - hex value"#FFF"set background color of the calendar
headerColor#{string} - hex value"#FFF"set header color of the calendar (month name on the top bar)
onMonthChange(data: number) => void() => nullreturns index of the month after month change event
onYearChange(data: number) => void() => nullreturns year after year change event
onClickDate({day: number, month: number, year: number, eventsInfo: Array<Event>}) => void() => nullreturns year, index of the month, day and array of events on selected date after click
1.1.1

2 years ago

1.1.0

2 years ago

1.1.2

2 years ago

1.0.1

2 years ago

0.9.7

2 years ago

0.9.6

2 years ago

0.9.5

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago