vael-ui v0.3.10

Forms & Inputs

Calendar

A month grid for picking a single date, multiple dates, or a range.

Install

import { Calendar } from 'vael-ui'

Playground

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
import { Calendar } from 'vael-ui'

<Calendar selectionMode="single" view="date" locale="en-US" :firstDayOfWeek="0" motionCss>Calendar</Calendar>

Props

NameTypeDefaultDescription
selectionMode"single" | "range""single"
view"date" | "month" | "year""date"
minDateDate | undefinedundefined
maxDateDate | undefinedundefined
disabledDatesCalendarDisabledDates | undefinedundefinedList of unavailable dates, or a predicate function. Matched by calendar day, ignoring time.
localestring | undefinedundefinedBCP-47 locale for month/weekday names and week start day. Omitted uses runtime default.
firstDayOfWeeknumber | undefinedundefined0 (Sunday) – 6 (Saturday). Omitted derives from `locale`, falling back to Sunday.
motionCssboolean | undefinedtrue`false` skips month-navigation slide transition.
uiPartial<{ root: UiPartValue; header: UiPartValue; navButton: UiPartValue; label: UiPartValue; weekdays: UiPartValue; weekday: UiPartValue; grid: UiPartValue; cell: UiPartValue; }> | undefinedundefined
modelValueDate | CalendarRange | null | undefinednull

Slots

NameTypeDescription
day{ date: Date; isCurrentMonth: boolean; isToday: boolean; isSelected: boolean; isDisabled: boolean; }Per-day cell content in the date grid - falls back to the day number when unused. Doesn't replace the cell's own click/hover/keyboard-focus wiring or its aria attributes, just what renders inside it, so a caller can badge/mark a day (e.g. "has N items scheduled") without forking the whole grid/keyboard-nav/month-transition logic Calendar already owns.

Events

NameTypeDescription
update:modelValue[value: Date | CalendarRange | null]
change[value: Date | CalendarRange | null]
month-change[value: Date]

Exposed

NameTypeDescription
rootElHTMLElement | null
gridElHTMLElement | null
goToPreviousMonth() => void
goToNextMonth() => void
focusDay(day: Date) => void