Socket
Socket
Sign inDemoInstall

@ericz1803/react-google-calendar

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ericz1803/react-google-calendar

React Google Calendar Component


Version published
Weekly downloads
194
increased by10.86%
Maintainers
1
Weekly downloads
 
Created
Source

React Google Calendar

npm (scoped) Build Status

A react component that displays an event calendar using data from google's calendar api. It is intended to replace the embedded google calendar.

See it in action here.

picture of calendar

Design inspired by this calendar.

Installation

npm install --save @ericz1803/google-react-calendar

Usage

First, get an api key from here by following step 1.

Alternately, you can go to https://console.developers.google.com/flows/enableapi?apiid=calendar.

Then, get the calendar id from the google calendar. It will look something like s9ajkhr604dfrmvm7185lesou0@group.calendar.google.com.
You can find it by going to a calendar's settings and scrolling down to the section that is labelled Integrate calendar.

Properties

ParameterTypeDescriptionDefault
apiKeystringgoogle api key (required)
calendarIdstringgoogle calendar id (required)

Customization

You can change the color of different aspects of the calendar by passing css colors (eg. #51565d or rgba(166, 168, 179, 0.12)) into the following props (as a string).

Calendar Colors
ParameterTypeDescriptionDefault
borderColorstringcolor of calendar lines"LightGray"
textColorstringcolor of the calendar text"#51565d"
backgroundColorstringcolor of the calendarnull
todayTextColorstringtext color of todaynull (same as textColor)
todayBackgroundColorstringcolor of todaynull (same as backgroundColor)
Tooltip Colors
ParameterTypeDescriptionDefault
tooltipBorderColorstringborder color of tooltip that pops up when you click on an event"rgba(81, 86, 93, 0.1)"
tooltipTextColorstringcolor of tooltip text"#51565d"
Single Event Colors

Applies to events that are shorter than 24h.

ParameterTypeDescriptionDefault
singleEventHoverColorstringcolor of the event on hover"rgba(81, 86, 93, 0.1)"
singleEventTextColorstringtext color of event"#51565d"
singleEventCircleColorstringcolor of the circle in front of the event text"#4786ff"
Event Colors

Applies to events that are All Day Events or span multiple days.

ParameterTypeDescriptionDefault
eventTextColorstringtext color of event"white"
eventBackgroundColorstringbackground color of event"#4786ff"
eventHoverColorstringcolor of the event on hover"#396DCC"

Example

import Calendar from "@ericz1803/react-google-calendar";

const API_KEY = "YOUR_API_KEY";
const CALENDAR_ID = "YOUR_CALENDAR_ID";

class Example extends React.Component {
  render() {
    let props = {
      singleEventCircleColor: 'SpringGreen',
      borderColor: 'SlateGrey',
    }

    return (
      <div>
        <Calendar apiKey={API_KEY} calendarId={CALENDAR_ID} {...props} />
      </div>
    )
  }
}

License

MIT License

FAQs

Package last updated on 02 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc