0.1.1 • Published 3 years ago

react-reminder-calendar v0.1.1

Weekly downloads
16
License
-
Repository
github
Last release
3 years ago

React Reminder Calendar

An events calendar component built for React and made for modern browsers.

npm (scoped)

screen shot

Installation

npm install --save react-reminder-calendar

Basic Sample

import ReminderCalendar from "react-remindar-calendar/dist"

const data = [
    {
        title: "TODAY, NOV 4",
        items: [
            {
                title: "Dinner with Richard",
                subTitle: "Richards House",
                icon: "fa fa-map-pin",
                startTime: "12:00",
                endTime: "13:00",
                isAllDay: false,
                allDayTitle: "All Day",
                separatorColor: "#26bdc6",
                style: {},
                infoViewComponent: null,
                rightViewComponent: null
            },
            {
                title: "Online meeting",
                subTitle: "Zoom",
                icon: "",
                startTime: "18:00",
                endTime: "19:30",
                isAllDay: false,
                allDayTitle: "All Day",
                separatorColor: "#a326c6",
                style: {},
                infoViewComponent: <div style={{fontSize: 12}}><small><b>Zoom Link</b>  <kbd>https://zoom.us/udyt4RE</kbd></small></div>,
                rightViewComponent: null
            }
        ],
        rightButton: {
            title: "+",
            show: true,
            props: {
                className: "",
                style: {backgroundColor: '#ccc', border: 'none', width: 22, height: 22}
            }
        }
    },
    {
        title: "TOMORROW, NOV 5",
        items: [
            {
                title: "Join the Summit",
                subTitle: "City Center",
                icon: "fa fa-map-pin",
                startTime: "10:00",
                endTime: "13:00",
                isAllDay: true,
                allDayTitle: "All Day",
                separatorColor: "#69c626",
                style: {},
                infoViewComponent: null,
                rightViewComponent: null
            },
            {
                title: "Enroll the online course",
                subTitle: "Udemy",
                icon: "",
                startTime: "18:00",
                endTime: "19:30",
                isAllDay: false,
                allDayTitle: "All Day",
                separatorColor: "#e5245a",
                style: {},
                infoViewComponent: null,
                rightViewComponent: null
            }
        ],
        rightButton: {
            title: "+",
            show: true,
            props: {
                className: "",
                style: {backgroundColor: '#ccc', border: 'none', width: 22, height: 22}
            }
        }
    }
]

class App extends React.Component {

    handleItemClick = (dateSection, item, index) => {
        
    }

    handleRightButtonClick = (dateSection, index) => {
        
    }
    
    render(){
        return(
            <ReminderCalendar
                shadow
                dateSections={data}
                onItemClick={this.handleItemClick}
                onDateSectionRightButtonClick={this.handleRightButtonClick}
            />
        )
    }
}

Props of ReminderCalendar

NameType/DefaultDescription
shadowfalse
dateSectionsarrayA javascript object array, please see Props of DateSection Items
customDateSectionRightButtonComponentIf you set this, default right button will be overrided.

Props of DateSection Items

NameDefaultDescription
titlestring
rightButtonobject or Componenttitle show and props
itemsarrayPlease see Props of Item

Props of Item

NameDefaultDescription
titlestring
subTitlestring
iconstring
startTimestring
endTimestring
isAllDayboolean false
allDayTitlestring
separatorColorstring
styleobject
infoViewComponentComponent
rightViewComponentComponent

Events

NameDescription
onItemClickfunction with returns dateSection item and index
onDateSectionRightButtonClickfunction with returns dateSection and index

Styling

  • View src/index.css for styling examples.

Contributing

Feel free to make a PR :) They are always welcome

0.1.1

3 years ago

0.1.0

3 years ago