Skip to content

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

Free

Calendar with Multiple Day Selection for Svelte

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

UI library: Ark UI

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 Svelte, Ark UI does not know which days matter.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

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

Usage

<Calendar class="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.