Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReactJS - How to style React Calendar

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>
)
}
}
like image 894
brainoverflow Avatar asked Jun 23 '18 16:06

brainoverflow


1 Answers

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']}/>
like image 158
mostafa tourad Avatar answered Sep 24 '22 09:09

mostafa tourad