Last active
June 13, 2024 14:53
-
-
Save diegohaz/deb541a7009112526c00bb35f612f691 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Calendar, | |
CalendarRow, | |
CalendarCell, | |
CalendarWeeks, | |
CalendarWeekDays, | |
} from "@ariakit/react"; | |
function MyCalendar() { | |
return ( | |
<Calendar defaultDate={new Date("2019-03-02")} firstWeekDay={1}> | |
<thead> | |
<tr> | |
<CalendarWeekDays> | |
{(days) => days.map((day) => ( | |
<th key={day}>{day.slice(0, 3)}</th> | |
))} | |
</CalendarWeekDays> | |
</tr> | |
</thead> | |
<tbody> | |
<CalendarWeeks> | |
{(weeks) => weeks.map((dates, i) => ( | |
<CalendarRow key={i}> | |
{dates.map((date) => ( | |
<CalendarCell key={date} date={date} /> | |
))} | |
</CalendarRow> | |
))} | |
</CalendarWeeks> | |
</tbody> | |
</Calendar> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment