UNPKG

593 BTypeScriptView Raw
1import React from "react";
2
3import { DayPicker } from "react-day-picker";
4
5const bookedDays = [
6 new Date(2021, 5, 8),
7 new Date(2021, 5, 9),
8 new Date(2021, 5, 11)
9];
10
11const style = `
12 .my-booked-class {
13 background-color: tomato;
14 color: white;
15 border-radius: 50%;
16 }
17`;
18
19export function ModifiersClassnames() {
20 return (
21 <>
22 <style>{style}</style>
23 <DayPicker
24 defaultMonth={bookedDays[0]}
25 modifiers={{
26 booked: bookedDays
27 }}
28 modifiersClassNames={{
29 booked: "my-booked-class"
30 }}
31 />
32 </>
33 );
34}