Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Calendar with Multiple Day Selection for Ark UI

A calendar that starts with the 6th, the 15th, and the 24th of this month selected, so several days can be chosen at once.

Three days start selected: the 6th, the 15th, and the 24th of this month. One month is on screen. Another click adds a day or drops one from that list.

Use it for dates that are not a continuous stretch, such as several shifts. A start and an end belong in a range. A field that opens this grid is a Date Picker. In React, Ark UI does not know which days matter.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Use email insteadNo credit card

Anatomy

Calendar anatomy: prev trigger, month select, year select, next trigger, table, table cell

Usage

<Calendar
  className="rounded-md border"
  onValueChange={handleValueChange}
  selectionMode="multiple"
  value={value}
>
  <CalendarViewControl>
    <CalendarPrevTrigger />
    <CalendarViewDate />
    <CalendarNextTrigger />
  </CalendarViewControl>
  <CalendarTable>
    <CalendarWeekDays />
    <CalendarTableDays />
  </CalendarTable>
</Calendar>

FAQ

How do I read the selected days?

selectionMode="multiple" makes value a list of dates, and onValueChange receives { value }. This demo starts with the 6th, the 15th and the 24th of the current month.

Which days start selected?

The 6th, the 15th and the 24th of the current month. State starts as those three dates, and the calendar renders the list its change handler returns.

What wraps the grid?

The Calendar className is rounded-md border. Several days come from the selection prop on that same element.

What does the change handler receive?

onValueChange receives { value }, the next list of dates, and this demo stores details.value.

How are the starting dates built?

selectedDates maps 6, 15 and 24 through parseDate for the current month.

How many months are on screen?

One. This demo sets no month count, so the grid is a single month with those three days selected.

API Reference

Calendar

Sets onValueChange={handleValueChange}, selectionMode="multiple" and value={value}. The rest is on the Calendar page.