kid
kid

Reputation: 1081

How to change background color of react-day-picker?

I would like to change the background color of the day picker but I can't seem to find a way. Here is my code:

.DayPicker-wraper {
  background-color: black;
}
<DayPickerInput 
        placeholder={"Date..."} 
        onDayChange={day => setNewDate(day)}
/>

And here is the DOM structure for the day picker

enter image description here

Upvotes: 0

Views: 1168

Answers (1)

Kahzpa
Kahzpa

Reputation: 11

In your example the class you're targetting is 'DayPicker-wraper' while the DOM seems to have the classname as 'DayPicker-wrapper'. Alternatively, could you not also add a className like so then target that?

<DayPickerInput 
    className='date-picker'
    placeholder={"Date..."} 
    onDayChange={day => setNewDate(day)}
/>

Upvotes: 1

Related Questions