I've just installed the react-calendar package using
npm install react-calendar
but I have no idea how to style it, or to give it some color. The instructions in react-calendar - npm do not provide any information about that. I was wondering if anyone that has used this package could help me here. This is the code I have:
import React, {Component} from 'react'
import Calendar from 'react-calendar'
export default class EventModifier extends Component {
state = {
date: new Date(2018, 6, 1)
}
render(){
let calendar = <Calendar onChange={this.onChange} value={this.state.date} onClickDay={(value) => alert("day" + value + "clicked")}/>
return(
<div>
{calendar}
</div>
)
}
}
Use className prop that will be added along with "react-calendar" to the main React-Calendar element. and it can be used to style the calendar as you want
<Calendar className={['c1','c2']}/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With