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.
Installation
Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
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.
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.
KeyAction
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.
EscEscape
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 }
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.
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
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.
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.
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 }
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