Demo
Multiple dates, bounds and outside days
Documented in Calendar.
Multiple dates, bounds and outside days
selectionMode="multiple" with a controlled array of dates, min and max bounds, Monday as the first day of the week, narrow weekday headers and visible outside days.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 26 | 27 | 28 | 29 | 30 | 31 | 1 |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 1 | 2 | 3 | 4 | 5 | 6 |
3 days: 2026-11-10, 2026-11-12, 2026-11-19
Demo.tsx
'use client';
import { useState } from 'react';
import { Calendar, type DateInput } from '@salmonui/calendars/calendar';
import { Button } from '@salmonui/buttons/button';
/** Multiple selection with a reactive value array, min / max bounds and Monday-first weeks. */
export default function CalendarMultipleDemo() {
const [dates, setDates] = useState<readonly DateInput[]>(['2026-11-10', '2026-11-12', '2026-11-19']);
return (
<div className="demo-stack">
<Calendar
aria-label="Shift days"
locale="en-GB"
selectionMode="multiple"
value={dates}
onValueChange={(next) => setDates(next)}
min="2026-11-02"
max="2026-12-20"
firstDayOfWeek={1}
weekdayFormat="narrow"
showOutsideDays
/>
<p className="demo-status">
{dates.length} days: <code>{dates.map(String).join(', ') || 'none'}</code>
</p>
<Button variant="outline" type="button" onClick={() => setDates([])}>
Clear
</Button>
</div>
);
}
Click or press Enter on a day to toggle it. The previous and next buttons
stop at the bounds and keyboard focus is clamped to them. The value is a
plain array: there are no addDate() / removeDate() methods.