Skip to content

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

Components

Free

Date Picker for Vue

A button or typed field that opens a month in a popover, for one date or a range, for Vue on Ark UI, with year menus and a time field.

On this page9 sections
UI library: Ark UI

A date picker is a form field for a date: a button, or a text input, that opens a month in a popover and closes once a day is picked, leaving the date written in the field. Use it when the date is one entry among others, as in a booking form or a profile.

When choosing the date is the main task and the month should stay in view, use a Calendar. For a date typed segment by segment with no popover at all, use a Date Input.

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.

Anatomy

Date Picker anatomy: content, prev trigger, next trigger, table cell, trigger, value

Usage

<script setup lang="ts">
import { ChevronDownIcon } from "lucide-vue-next";
import { Button } from "@/components/ui/button";
import {
  DatePicker, DatePickerContent, DatePickerNextTrigger,
  DatePickerPrevTrigger, DatePickerTable, DatePickerTableDays,
  DatePickerTrigger, DatePickerValue, DatePickerViewControl,
  DatePickerViewDate, DatePickerWeekDays,
} from "@/components/ui/date-picker";
</script>

DatePickerTrigger renders your own Button as the trigger, DatePickerValue writes the picked date or the placeholder inside it, and everything in DatePickerContent shows in the popover.

<template>
  <DatePicker>
    <DatePickerTrigger as-child>
      <Button
        class="w-[212px] justify-between font-normal"
        variant="outline"
      >
        <DatePickerValue placeholder="Pick a date" />
        <ChevronDownIcon aria-hidden="true" data-icon="inline-end" />
      </Button>
    </DatePickerTrigger>
    <DatePickerContent>
      <DatePickerViewControl>
        <DatePickerPrevTrigger />
        <DatePickerViewDate />
        <DatePickerNextTrigger />
      </DatePickerViewControl>
      <DatePickerTable>
        <DatePickerWeekDays />
        <DatePickerTableDays />
      </DatePickerTable>
    </DatePickerContent>
  </DatePicker>
</template>

Accessibility

The trigger is a button that tells assistive tech it opens a grid and whether it is open, and opening moves focus into the grid, onto the selected day when there is one. Each day is labeled with its full date, and the picked date is announced. The trigger is named Open calendar followed by what its DatePickerValue shows, the date or the placeholder. Pass the field label's id to DatePickerTrigger as aria-labelledby, as the Basic demo does, and the label takes the place of Open calendar.

Enter
On the trigger, opens the calendar. On a day, selects it and closes the calendar, or in a range waits for the second day. In the input, commits the typed date.
Space
On the trigger, opens the calendar. On a day, selects it as a click does.
Arrow Left
Moves focus to the previous day, into the previous week or month when it has to.
Arrow Right
Moves focus to the next day, into the next week or month when it has to.
Arrow Up
Moves focus to the same day of the week in the previous week.
Arrow Down
Moves focus to the same day of the week in the next week.
Home
Moves focus to the first day of the first visible month.
End
Moves focus to the last day of the last visible month.
Page Up
Moves focus to the same day of the month in the previous month.
Page Down
Moves focus to the same day of the month in the next month.
Shift+Page Up
Moves focus to the same day in the previous year.
Shift+Page Down
Moves focus to the same day in the next year.
Escape
Closes the calendar without changing the date.

Demos

Basic

A button under a Date label that reads Pick a date until a day is chosen, then shows it as month, day and year in digits. The popover holds one month with previous and next buttons, and the click that picks a day closes it. Use this shape for a date close to today in a form, such as a delivery or a start date.

Preview width

Range

Two months open side by side, with January 20 of this year to 20 days later already selected, so the button shows both dates with a hyphen between them. The next click starts a new range, and the one after it ends the range and closes the popover. Opening it puts keyboard focus on January 20, the start of the range.

Preview width

Disabled dates

Weekends, the 3rd through the 7th of this month and the 22nd can't be picked: isDateUnavailable returns true for each, and they stay in the grid with a line through the number. The button shows the picked date in long form, written by the demo itself. Add min set to today when the past should close as well.

Preview width

DOB

A date of birth field with month and year menus between the arrows, so a year decades back is one choice instead of hundreds of clicks on Previous. open and value are held in state, and picking a day closes the popover. For a real birth date, set max to today as well, so future days and years can't be chosen.

Preview width

Input

A text field under a Subscription Date label, starting at June 1, 2025, with a calendar button at its end. People type digits in the locale's order, 06/01/2025 in US English, and Enter or leaving the field commits the date. Emptied, it shows the locale's pattern, mm/dd/yyyy. The label points at an id passed to DatePickerInput, since the picker otherwise gives the input an id of its own.

Preview width

Time

A Date button and a Time field side by side. The time is a DatePickerTimer, a native time input with seconds that starts at 10:30:00, and the date popover has month and year menus. The two values stay separate until you join them when you save, as for an appointment that needs a day and an hour.

Preview width

Natural language

A text field that starts with In 2 days filled in and understands today, tomorrow, next week and in a number of days, plus any string Date.parse reads. A phrase it understands sets the date as you type, and the line underneath spells it out. ArrowDown or the calendar button opens the month. The parsing is the demo's own code, in English, so write your own for other phrases.

Preview width

RTL

The picker in Arabic, inside a LocaleProvider with the ar locale, so the placeholder, the weekday names and the grid read right to left. The popover renders at the end of the page, outside any wrapper, and still gets the direction, because the provider hands it to every part. A dir on the picker or on a parent element reaches neither the popover nor the arrow keys.

Preview width

FAQ

How do I get the selected date from the Date Picker in Vue?

Bind a ref with v-model, which reads and writes an array of DateValue objects even for one date, and listen to @value-change when you also want valueAsString, the dates formatted for the locale. Call toString() on a date for an ISO string such as 2026-11-11, or toDate with a time zone for a JavaScript Date.

How do I select a date range with the Date Picker?

Set selectionMode to range. The first click sets the start, the second sets the end and closes the popover, and the value holds the two dates in order. Set numOfMonths to 2 and put DatePickerTableNextMonth in a second table to show two months side by side, as the Range demo does.

Give DatePickerValue a separator, such as a hyphen with spaces, for the text on the button. For separate dates instead, set selectionMode to multiple, and the popover stays open while people click.

How do I disable past dates or weekends in the Date Picker?

Set min to today, made with today and getLocalTimeZone from @internationalized/date, and the days before it are struck through, can't be picked, and Previous stops at that month. max does the same for days after a date.

For weekends, holidays or booked days, pass isDateUnavailable, which gets each date and the locale and returns true for a day to block, as the Disabled dates demo does. Blocked days stay in the grid, and Enter does nothing on them.

How do I make a birthday Date Picker that jumps to a year?

Put DatePickerMonthSelect and DatePickerYearSelect between the arrows, as the DOB demo does, so 1984 is one choice in a list instead of hundreds of clicks back. The year list runs from 1900 to 2099 unless you narrow it.

Set max to today, which disables the future days and ends the year list at this year, and min to the earliest date that makes sense for your form, whose year then opens the list.

Can users type a date in the Date Picker instead of clicking?

Yes, use DatePickerInput in place of the trigger button, as the Input demo does, and the calendar opens from the button at its end. The field takes digits and the separator in the locale's order, such as 06/01/2025 in US English, and commits the date on Enter or when it loses focus. Give it an id for the field's label to point at, since the picker sets an id of its own.

For phrases such as tomorrow or in 3 days, the Natural language demo parses the text itself and keeps a calendar for clicking.

How do I pick a date and a time with the Date Picker?

Put a DatePickerTimer next to the picker, as the Time demo does. It is a native time input with seconds, and its value stays apart from the date, so join the two when you save, from the date's year, month and day and the time's hours and minutes.

For a date and time typed into one field, segment by segment, use a Date Input with granularity set to minute.

How do I change the Date Picker language and the first day of the week?

Set locale, such as fr-FR or de-DE, and the month and weekday names, the date on the button and the input's format all follow it. Set startOfWeek to a number from 0 for Sunday to 6 for Saturday to choose the first column, or leave it out and the locale decides.

The direction doesn't follow locale, and dir on the picker doesn't reach its parts. For Arabic or Hebrew, wrap the picker in a LocaleProvider with that locale instead, which sets the language and the direction together, as the RTL demo does.

Why does the Date Picker open above the field?

This component passes positioning with placement set to top unless you pass your own, so the popover opens upward and flips below only when there isn't room above. Pass positioning with placement set to bottom-start to open it under the field, lined up with its start edge.

The same object takes gutter, the gap between the field and the popover in pixels, which is 8 by default.

API Reference

DatePicker

data-slot="date-picker"

PropType
open?boolean

The controlled open state of the date picker. Two-way with v-model:open.

defaultOpen?boolean

The initial open state of the date picker when rendered. Use when you don't need to control the open state of the date picker.

value?DateValue[]

The controlled selected date(s). Two-way with v-model.

defaultValue?DateValue[]

The initial selected date(s) when rendered. Use when you don't need to control the selected date(s) of the date picker.

view?"day" | "month" | "year"

The view of the calendar. Two-way with v-model:view.

Type
"day" | "month" | "year"
defaultView?"day" | "month" | "year"

The default view of the calendar.

Type
"day" | "month" | "year"
Default
"day"
idstring

The unique identifier of the machine.

closeOnSelect?boolean

Whether the calendar should close after the date selection is complete. This is ignored when the selection mode is multiple.

Default
true
createCalendar?(identifier: CalendarIdentifier) → Calendar

A function that creates a Calendar object for a given calendar identifier. Enables non-Gregorian calendar support (Persian, Buddhist, Islamic, etc.) without bundling all calendars by default. import { createCalendar } from "@internationalized/date" { locale: "fa-IR", createCalendar }

Type
(identifier: CalendarIdentifier) → Calendar
Parameters

identifier – CalendarIdentifier

Returns
Calendar
defaultFocusedValue?CalendarDate | CalendarDateTime | ZonedDateTime

The initial focused date when rendered. Use when you don't need to control the focused date of the date picker.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
dir?"ltr" | "rtl"

The document's text/writing direction.

Type
"ltr" | "rtl"
Default
"ltr"
disabled?boolean

Whether the calendar is disabled.

fixedWeeks?boolean

Whether the calendar should have a fixed number of weeks. This renders the calendar with 6 weeks instead of 5 or 6.

focusedValue?CalendarDate | CalendarDateTime | ZonedDateTime

The controlled focused date.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
format?(date: DateValue, details: LocaleDetails) → string

The format of the date to display in the input.

Type
(date: DateValue, details: LocaleDetails) → string
Parameters

date – DateValue

details – { locale: string; timeZone: string }

Returns
string
hideMode?"display-none" | "activity"

How to hide content when mounted but not present. - display-none: HTML hidden attribute. Effects stay alive. - activity: React 19 <Activity mode="hidden">. Effects pause. Requires React 19+.

Type
"display-none" | "activity"
Default
"display-none"
ids?object

The ids of the elements in the date picker. Useful for composition.

Type
{ root?: string; label?: (index: number) → string; table?: (id: string) → string; tableHeader?: (id: string) → string; tableBody?: (id: string) → string; tableRow?: (id: string) → string; content?: string; cellTrigger?: (id: string) → string; prevTrigger?: (view: DateView) → string; nextTrigger?: (view: DateView) → string; viewTrigger?: (view: DateView) → string; clearTrigger?: string; control?: string; input?: (index: number) → string; trigger?: string; monthSelect?: string; yearSelect?: string; positioner?: string }
immediate?boolean

Whether to synchronize the present change immediately or defer it to the next frame.

inline?boolean

Whether to render the date picker inline.

Default
false
invalid?boolean

Whether the date picker is invalid.

isDateUnavailable?(date: DateValue, locale: string) → boolean

Returns whether a date of the calendar is available.

Type
(date: DateValue, locale: string) → boolean
Parameters

date – DateValue

locale – string

Returns
boolean
lazyMount?boolean

Whether to enable lazy mounting.

Default
false
locale?string

The locale (BCP 47 language tag) to use when formatting the date.

Default
"en-US"
max?CalendarDate | CalendarDateTime | ZonedDateTime

The maximum date that can be selected.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
maxSelectedDates?number

The maximum number of dates that can be selected. This is only applicable when selectionMode is multiple.

maxView?"day" | "month" | "year"

The maximum view of the calendar.

Type
"day" | "month" | "year"
Default
"year"
min?CalendarDate | CalendarDateTime | ZonedDateTime

The minimum date that can be selected.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
minView?"day" | "month" | "year"

The minimum view of the calendar.

Type
"day" | "month" | "year"
Default
"day"
name?string

The name attribute of the input element.

numOfMonths?number

The number of months to display.

onEnterComplete?VoidFunction

Function called when the animation ends in the open state.

onExitComplete?VoidFunction

Function called when the animation ends in the closed state.

openOnClick?boolean

Whether to open the calendar when the input is clicked.

Default
false
outsideDaySelectable?boolean

Whether day outside the visible range can be selected.

Default
false
parse?(value: string, details: LocaleDetails) → DateValue

Function to parse the date from the input back to a DateValue.

Type
(value: string, details: LocaleDetails) → DateValue
Parameters

value – string

details – { locale: string; timeZone: string }

Returns
DateValue
placeholder?string

The placeholder text to display in the input.

positioning?object

The user provided options used to position the date picker content.

Type
{ restoreStyles?: boolean; applyStyles?: boolean; hideWhenDetached?: boolean; strategy?: "absolute" | "fixed"; placement?: Placement; offset?: { mainAxis?: number; crossAxis?: number; }; gutter?: number; shift?: number; overflowPadding?: number; arrowPadding?: number; flip?: boolean | Placement[]; slide?: boolean; overlap?: boolean; sameWidth?: boolean; fitViewport?: boolean; sizeMiddleware?: boolean; boundary?: (() → Boundary) | Boundary | "clipping-ancestors"; listeners?: boolean | AutoUpdateOptions; onComplete?: (data: ComputePositionReturn) → void; onPositioned?: ((data: { placed: boolean; }) → void); getAnchorElement?: () → HTMLElement | VirtualElement | null; getAnchorRect?: (element: HTMLElement | VirtualElement | null) → AnchorRect | null; updatePosition?: ((data: { updatePosition: () → Promise<void>; floatingElement: HTMLElement | null; }) → void | Promise<void>) }
Default
{ placement: "top" }
present?boolean

Whether the node is present (controlled by the user).

readOnly?boolean

Whether the calendar is read-only.

required?boolean

Whether the date picker is required.

selectionMode?"single" | "multiple" | "range"

The selection mode of the calendar. - single - only one date can be selected - multiple - multiple dates can be selected - range - a range of dates can be selected

Type
"single" | "multiple" | "range"
Default
"single"
showWeekNumbers?boolean

Whether to show the week number column in the day view.

skipAnimationOnMount?boolean

Whether to allow the initial presence animation.

Default
false
startOfWeek?number

The first day of the week. 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday

timeZone?string

The time zone to use.

Default
"UTC"
translations?object

The localized messages to use.

Type
{ dayCell?: (state: DayTableCellState) → string; nextTrigger?: (view: DateView) → string; monthSelect?: string; yearSelect?: string; viewTrigger?: (view: DateView, nextView: DateView) → string; prevTrigger?: (view: DateView) → string; presetTrigger?: (value: string[]) → string; clearTrigger?: string; trigger?: (open: boolean) → string; content?: string; placeholder?: ((locale: string) → { year: string; month: string; day: string; }); weekColumnHeader?: string; weekNumberCell?: (weekNumber: number) → string }
unmountOnExit?boolean

Whether to unmount on exit.

Default
false
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

EventType
@open-change(details: OpenChangeDetails) → void

Function called when the calendar opens or closes.

Type
(details: OpenChangeDetails) → void
Parameters

details – { open: boolean; value: DateValue[] }

Returns
void
@value-change(details: ValueChangeDetails) → void

Function called when the value changes.

Type
(details: ValueChangeDetails) → void
Parameters

details – { value: DateValue[]; valueAsString: string[]; view: DateView }

Returns
void
@view-change(details: ViewChangeDetails) → void

Function called when the view changes.

Type
(details: ViewChangeDetails) → void
Parameters

details – { view: DateView }

Returns
void
@focus-change(details: FocusChangeDetails) → void

Function called when the focused date changes.

Type
(details: FocusChangeDetails) → void
Parameters

details – { focusedValue: DateValue; view: DateView }

Returns
void
@visible-range-change(details: VisibleRangeChangeDetails) → void

Function called when the visible range changes.

Type
(details: VisibleRangeChangeDetails) → void
Parameters

details – { view: DateView; visibleRange: { start: DateValue; end: DateValue; } }

Returns
void
AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerContent

<div> data-slot="date-picker-content"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

class?string

Merged with the part's classes.

AttributeType
data-has-nested?string

Present when another popover is nested inside it.

data-inline?string

Present when the content is inline.

data-nested?string

Present when it's nested inside another popover.

data-placementstring

The placement of the content.

data-side"top" | "right" | "bottom" | "left"

The side of the trigger that the content is positioned on.

Type
"top" | "right" | "bottom" | "left"
data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"
CSS variableType
--layer-indexstring

The index of the dismissable in the layer stack.

--nested-layer-countstring

The number of nested date-pickers.

--transform-originstring

Where the content scales from, on its trigger's side.

DatePickerControl

<div> data-slot="date-picker-control"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled.

data-invalid?string

Present when invalid.

data-placeholder-shown?string

Present when placeholder is shown.

DatePickerInput

<input> data-slot="date-picker-input"

PropType
fixOnBlur?boolean

Whether to fix the input value on blur.

Default
true
index?number

The index of the input to focus.

asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

class?string

Merged with the part's classes.

AttributeType
data-index?string

The index of the item.

data-invalid?string

Present when invalid.

data-placeholder-shown?string

Present when placeholder is shown.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerPositioner

<div> data-slot="date-picker-positioner"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-has-nested?string

Present when the positioner has nested date pickers.

data-nested?string

Present when the positioner is nested within another date picker.

CSS variableType
--available-heightstring

The available height in viewport.

--available-widthstring

The available width in viewport.

--reference-heightstring

The height of the root.

--reference-widthstring

The width of the reference element.

--transform-originstring

The transform origin for animations.

--xstring

The x position for transform.

--ystring

The y position for transform.

--z-indexstring

The z-index value.

DatePickerPresetTrigger

<button> data-slot="date-picker-preset-trigger"

PropType
valueDateValue[] | DateRangePreset

The preset trigger's value.

Type
DateValue[] | DateRangePreset
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

DatePickerTrigger

<button> data-slot="date-picker-trigger"

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

class?string

Merged with the part's classes.

AttributeType
data-placeholder-shown?string

Present when placeholder is shown.

data-placementstring

The placement of the trigger.

data-side"top" | "right" | "bottom" | "left"

The side of the trigger that the trigger is positioned on.

Type
"top" | "right" | "bottom" | "left"
data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerClearTrigger

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerLabel

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerMonthSelect

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerNextTrigger

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerPrevTrigger

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerRootProvider

PropType
valueUseDatePickerReturn

What useDatePicker() returns: the state and API, made outside the component to control it.

hideMode?"display-none" | "activity"

How to hide content when mounted but not present. - display-none: HTML hidden attribute. Effects stay alive. - activity: React 19 <Activity mode="hidden">. Effects pause. Requires React 19+.

Type
"display-none" | "activity"
Default
"display-none"
immediate?boolean

Whether to synchronize the present change immediately or defer it to the next frame.

lazyMount?boolean

Whether to enable lazy mounting.

Default
false
onEnterComplete?VoidFunction

Function called when the animation ends in the open state.

onExitComplete?VoidFunction

Function called when the animation ends in the closed state.

present?boolean

Whether the node is present (controlled by the user).

skipAnimationOnMount?boolean

Whether to allow the initial presence animation.

Default
false
unmountOnExit?boolean

Whether to unmount on exit.

Default
false
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTable

PropType
columns?number

How many cells each row holds, for months and years.

asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableBody

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableCell

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableDays

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableHead

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableHeader

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableMonths

PropType
columns?number

How many months each row holds.

format?"short" | "long"

How month names are written: short (Jan) or long (January).

Type
"short" | "long"
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableNextMonth

PropType
months?number

The number of months to offset.

Default
1
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableRow

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTableYears

PropType
columns?number

How many years each row holds.

asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTodayTrigger

PropType
clickEffect?boolean

Apply a click effect to the button.

Default
true
isLoading?boolean

Show a loading indicator.

Default
false
pill?boolean

Fully rounded corners.

Default
false
size?"default" | "icon" | "icon-lg" | "icon-md" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "md" | "sm" | "xl" | "xs"

The size.

Type
"default" | "icon" | "icon-lg" | "icon-md" | "icon-sm" | "icon-xl" | "icon-xs" | "lg" | "md" | "sm" | "xl" | "xs"
Default
"md"
variant?"default" | "destructive" | "ghost" | "link" | "outline" | "secondary"

The visual style.

Type
"default" | "destructive" | "ghost" | "link" | "outline" | "secondary"
Default
"default"
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerView

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerViewControl

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerViewDate

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerViewTrigger

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerWeekDays

PropType
format?"narrow" | "short" | "long"

Weekday label width. short is two letters (Su), matching the other calendar bases, or the whole short name where two letters would repeat (Arabic and Hebrew short names share their first two).

Type
"narrow" | "short" | "long"
Default
"short"
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerWeekNumberCell

PropType
weekDateValue[]

The week's days, the row it numbers.

weekIndexnumber

The week's row in the month, from 0.

asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerWeekNumberHeaderCell

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerYearSelect

PropType
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerTimer

PropType
size?"lg" | "md" | "sm"

The size.

Type
"lg" | "md" | "sm"
Default
"md"
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

class?string

Merged with the part's classes.

AttributeType
data-disabled?string

Present when disabled is true.

data-empty?string

Present when empty is true.

data-readonly?string

Present when readOnly is true.

data-state"open" | "closed"

"open" or "closed".

Type
"open" | "closed"

DatePickerValue

<span> data-slot="date-picker-value"

PropType
children?(props: DatePickerValueTextRenderProps) → VNode

A function to render each selected date value. When provided, each date in the selection will be rendered using this function.

Type
(props: DatePickerValueTextRenderProps) → VNode
Parameters

props – { value: DateValue; index: number; valueAsString: string; remove: () → void }

Returns
React.ReactNode
placeholder?string

Text to display when no date is selected.

separator?string

The separator to use between multiple date values when using default rendering.

Default
", "
asChild?boolean

Use the provided child element as the default rendered element, combining their props and behavior.

class?string

Merged with the part's classes.

useDatePicker

PropType
open?boolean

The controlled open state of the date picker. Two-way with v-model:open.

defaultOpen?boolean

The initial open state of the date picker when rendered. Use when you don't need to control the open state of the date picker.

value?DateValue[]

The controlled selected date(s). Two-way with v-model.

defaultValue?DateValue[]

The initial selected date(s) when rendered. Use when you don't need to control the selected date(s) of the date picker.

view?"day" | "month" | "year"

The view of the calendar. Two-way with v-model:view.

Type
"day" | "month" | "year"
defaultView?"day" | "month" | "year"

The default view of the calendar.

Type
"day" | "month" | "year"
Default
"day"
closeOnSelect?boolean

Whether the calendar should close after the date selection is complete. This is ignored when the selection mode is multiple.

Default
true
createCalendar?(identifier: CalendarIdentifier) → Calendar

A function that creates a Calendar object for a given calendar identifier. Enables non-Gregorian calendar support (Persian, Buddhist, Islamic, etc.) without bundling all calendars by default. import { createCalendar } from "@internationalized/date" { locale: "fa-IR", createCalendar }

Type
(identifier: CalendarIdentifier) → Calendar
Parameters

identifier – CalendarIdentifier

Returns
Calendar
defaultFocusedValue?CalendarDate | CalendarDateTime | ZonedDateTime

The initial focused date when rendered. Use when you don't need to control the focused date of the date picker.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
disabled?boolean

Whether the calendar is disabled.

fixedWeeks?boolean

Whether the calendar should have a fixed number of weeks. This renders the calendar with 6 weeks instead of 5 or 6.

focusedValue?CalendarDate | CalendarDateTime | ZonedDateTime

The controlled focused date.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
format?(date: DateValue, details: LocaleDetails) → string

The format of the date to display in the input.

Type
(date: DateValue, details: LocaleDetails) → string
Parameters

date – DateValue

details – { locale: string; timeZone: string }

Returns
string
id?string

The unique identifier of the machine.

ids?object

The ids of the elements in the date picker. Useful for composition.

Type
{ root?: string; label?: (index: number) → string; table?: (id: string) → string; tableHeader?: (id: string) → string; tableBody?: (id: string) → string; tableRow?: (id: string) → string; content?: string; cellTrigger?: (id: string) → string; prevTrigger?: (view: DateView) → string; nextTrigger?: (view: DateView) → string; viewTrigger?: (view: DateView) → string; clearTrigger?: string; control?: string; input?: (index: number) → string; trigger?: string; monthSelect?: string; yearSelect?: string; positioner?: string }
inline?boolean

Whether to render the date picker inline.

invalid?boolean

Whether the date picker is invalid.

isDateUnavailable?(date: DateValue, locale: string) → boolean

Returns whether a date of the calendar is available.

Type
(date: DateValue, locale: string) → boolean
Parameters

date – DateValue

locale – string

Returns
boolean
locale?string

The locale (BCP 47 language tag) to use when formatting the date.

Default
"en-US"
max?CalendarDate | CalendarDateTime | ZonedDateTime

The maximum date that can be selected.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
maxSelectedDates?number

The maximum number of dates that can be selected. This is only applicable when selectionMode is multiple.

maxView?"day" | "month" | "year"

The maximum view of the calendar.

Type
"day" | "month" | "year"
Default
"year"
min?CalendarDate | CalendarDateTime | ZonedDateTime

The minimum date that can be selected.

Type
CalendarDate | CalendarDateTime | ZonedDateTime
minView?"day" | "month" | "year"

The minimum view of the calendar.

Type
"day" | "month" | "year"
Default
"day"
name?string

The name attribute of the input element.

numOfMonths?number

The number of months to display.

openOnClick?boolean

Whether to open the calendar when the input is clicked.

Default
false
outsideDaySelectable?boolean

Whether day outside the visible range can be selected.

Default
false
parse?(value: string, details: LocaleDetails) → DateValue

Function to parse the date from the input back to a DateValue.

Type
(value: string, details: LocaleDetails) → DateValue
Parameters

value – string

details – { locale: string; timeZone: string }

Returns
DateValue
placeholder?string

The placeholder text to display in the input.

positioning?object

The user provided options used to position the date picker content.

Type
{ restoreStyles?: boolean; applyStyles?: boolean; hideWhenDetached?: boolean; strategy?: "absolute" | "fixed"; placement?: Placement; offset?: { mainAxis?: number; crossAxis?: number; }; gutter?: number; shift?: number; overflowPadding?: number; arrowPadding?: number; flip?: boolean | Placement[]; slide?: boolean; overlap?: boolean; sameWidth?: boolean; fitViewport?: boolean; sizeMiddleware?: boolean; boundary?: (() → Boundary) | Boundary | "clipping-ancestors"; listeners?: boolean | AutoUpdateOptions; onComplete?: (data: ComputePositionReturn) → void; onPositioned?: ((data: { placed: boolean; }) → void); getAnchorElement?: () → HTMLElement | VirtualElement | null; getAnchorRect?: (element: HTMLElement | VirtualElement | null) → AnchorRect | null; updatePosition?: ((data: { updatePosition: () → Promise<void>; floatingElement: HTMLElement | null; }) → void | Promise<void>) }
readOnly?boolean

Whether the calendar is read-only.

required?boolean

Whether the date picker is required.

selectionMode?"single" | "multiple" | "range"

The selection mode of the calendar. - single - only one date can be selected - multiple - multiple dates can be selected - range - a range of dates can be selected

Type
"single" | "multiple" | "range"
Default
"single"
showWeekNumbers?boolean

Whether to show the week number column in the day view.

startOfWeek?number

The first day of the week. 0 - Sunday 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday

timeZone?string

The time zone to use.

Default
"UTC"
translations?object

The localized messages to use.

Type
{ dayCell?: (state: DayTableCellState) → string; nextTrigger?: (view: DateView) → string; monthSelect?: string; yearSelect?: string; viewTrigger?: (view: DateView, nextView: DateView) → string; prevTrigger?: (view: DateView) → string; presetTrigger?: (value: string[]) → string; clearTrigger?: string; trigger?: (open: boolean) → string; content?: string; placeholder?: ((locale: string) → { year: string; month: string; day: string; }); weekColumnHeader?: string; weekNumberCell?: (weekNumber: number) → string }
EventType
@open-change(details: OpenChangeDetails) → void

Function called when the calendar opens or closes.

Type
(details: OpenChangeDetails) → void
Parameters

details – { open: boolean; value: DateValue[] }

Returns
void
@value-change(details: ValueChangeDetails) → void

Function called when the value changes.

Type
(details: ValueChangeDetails) → void
Parameters

details – { value: DateValue[]; valueAsString: string[]; view: DateView }

Returns
void
@view-change(details: ViewChangeDetails) → void

Function called when the view changes.

Type
(details: ViewChangeDetails) → void
Parameters

details – { view: DateView }

Returns
void
@focus-change(details: FocusChangeDetails) → void

Function called when the focused date changes.

Type
(details: FocusChangeDetails) → void
Parameters

details – { focusedValue: DateValue; view: DateView }

Returns
void
@visible-range-change(details: VisibleRangeChangeDetails) → void

Function called when the visible range changes.

Type
(details: VisibleRangeChangeDetails) → void
Parameters

details – { view: DateView; visibleRange: { start: DateValue; end: DateValue; } }

Returns
void