Calendar
Displays dates and days of the week, facilitating date-related interactions.
Features
- Full keyboard navigation
- Can be controlled or uncontrolled
- Focus is fully managed
- Localization support
- Highly composable
Install
Import
API
Root
Props | Type | Default |
---|---|---|
as | AsTag | Component | div |
asChild | boolean | false |
calendarLabel | string | - |
defaultPlaceholder | DateValue | - |
defaultValue | DateValue | undefined |
dir | Direction | ltr |
disabled | boolean | false |
fixedWeeks | boolean | false |
initialFocus | boolean | false |
isDateDisabled | Matcher | undefined |
isDateUnavailable | Matcher | undefined |
locale | 'tr' | 'th' | 'ach' | 'af' | 'am' | 'an' | 'ar' | 'ast' | 'az' | 'be' | 'bg' | 'bn' | 'br' | 'bs' | 'ca' | 'cak' | 'ckb' | 'cs' | 'cy' | 'da' | 'de' | 'dsb' | 'el' | 'en' | 'eo' | 'es' | ... 49 more ... | - |
maxValue | DateValue | - |
minValue | DateValue | - |
modelValue | DateValue | DateValue[] | - |
multiple | boolean | false |
numberOfMonths | number | 1 |
pagedNavigation | boolean | false |
placeholder | DateValue | undefined |
preventDeselect | boolean | false |
readonly | boolean | false |
weekdayFormat | WeekDayFormat | narrow |
weekStartsOn | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 0 |
Event | Type |
---|---|
update:modelValue | [_value: DateValue] |
update:placeholder | [_value: DateValue] |
Slot (default) | Type |
---|---|
date | DateValue |
grid | Grid<DateValue> |
weekDays | string[] |
Data attribute | Value |
---|---|
[data-readonly] | Present when readonly |
[data-disabled] | Present when disabled |
[data-invalid] | Present when invalid |
Header
Props | Type | Default |
---|---|---|
as | AsTag | Component | div |
asChild | boolean | false |
Heading
Props | Type | Default |
---|---|---|
as | AsTag | Component | div |
asChild | boolean | false |
Slot (default) | Type |
---|---|
headingValue | string |
Data attribute | Value |
---|---|
[data-disabled] | Present when disabled |
Prev
Props | Type | Default |
---|---|---|
as | AsTag | Component | button |
asChild | boolean | false |
Data attribute | Value |
---|---|
[data-disabled] | Present when disabled |
Next
Props | Type | Default |
---|---|---|
as | AsTag | Component | button |
asChild | boolean | false |
Data attribute | Value |
---|---|
[data-disabled] | Present when disabled |
Grid
Props | Type | Default |
---|---|---|
as | AsTag | Component | table |
asChild | boolean | false |
Data attribute | Value |
---|---|
[data-readonly] | Present when readonly |
[data-disabled] | Present when disabled |
Grid Head
Props | Type | Default |
---|---|---|
as | AsTag | Component | thead |
asChild | boolean | false |
Grid Body
Props | Type | Default |
---|---|---|
as | AsTag | Component | tbody |
asChild | boolean | false |
Grid Row
Props | Type | Default |
---|---|---|
as | AsTag | Component | tr |
asChild | boolean | false |
Head Cell
Props | Type | Default |
---|---|---|
as | AsTag | Component | th |
asChild | boolean | false |
Cell
Props | Type | Default |
---|---|---|
as | AsTag | Component | tds |
asChild | boolean | false |
date | DateValue | - |
Data attribute | Value |
---|---|
[data-disabled] | Present when disabled |
Cell Trigger
Props | Type | Default |
---|---|---|
as | AsTag | Component | div |
asChild | boolean | false |
day | DateValue | - |
month | DateValue | - |
Data attribute | Value |
---|---|
[data-disabled] | Present when disabled |
[data-selected] | Present when selected |
[data-value] | The ISO string value of the date. |
[data-unavailable] | Present when unavailable |
[data-today] | Present when today |
[data-outside-view] | Present when the date is outside the current month it is displayed in. |
[data-outside-visible-view] | Present when the date is outside the months that are visible on the calendar. |
[data-focused] | Present when focused |