Keyboard shortcut: Ctrl + K
Get started

Date picker

VDatePicker is an inline calendar for a date, a range or several dates. Values are local dates in YYYY-MM-DD format.

Usage

vue
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker } from 'vectis-ui'

const date = ref('2026-06-10')
</script>

<template>
  <VDatePicker v-model="date" />
</template>

Examples

Range

Select the start and end of the range in two steps. The model is { start, end }; either bound can be null while the range is incomplete.

vue
MonTueWedThuFriSatSun
2026-06-19 to 2026-06-26
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker, type DatePickerRange } from 'vectis-ui'

const period = ref<DatePickerRange>({ start: '2026-06-19', end: '2026-06-26' })
</script>

<template>
  <div class="column">
    <VDatePicker v-model="period" selection="range" />
    <output class="value" aria-label="Chosen period">
      {{ period.start ?? 'none' }} to {{ period.end ?? 'none' }}
    </output>
  </div>
</template>

<style scoped>
.column {
  display: grid;
  justify-items: start;
  gap: var(--vectis-space-3);
}
.value {
  font-family: var(--vectis-text-family-code);
  font-size: var(--vectis-text-body-sm-size);
  color: var(--vectis-color-text-muted);
}
</style>

Multiple dates

Select dates to add them to the ISO date array; select them again to remove them.

vue
MonTueWedThuFriSatSun
2026-06-05, 2026-06-12, 2026-06-19
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker } from 'vectis-ui'

const dates = ref<string[]>(['2026-06-05', '2026-06-12', '2026-06-19'])
</script>

<template>
  <div class="column">
    <VDatePicker v-model="dates" selection="multiple" />
    <output class="value" aria-label="Chosen dates">{{ dates.join(', ') || 'none' }}</output>
  </div>
</template>

<style scoped>
.column {
  display: grid;
  justify-items: start;
  gap: var(--vectis-space-3);
}
.value {
  font-family: var(--vectis-text-family-code);
  font-size: var(--vectis-text-body-sm-size);
  color: var(--vectis-color-text-muted);
}
</style>

Presets

Place preset date buttons in footer and update the model from them.

vue
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VButton, VDatePicker } from 'vectis-ui'

const date = ref('2026-06-10')

/* Read today's local date in the click handler to avoid a prerendered value. */
function inDays(offset: number) {
  const day = new Date()
  day.setDate(day.getDate() + offset)
  const month = String(day.getMonth() + 1).padStart(2, '0')
  date.value = `${day.getFullYear()}-${month}-${String(day.getDate()).padStart(2, '0')}`
}
</script>

<template>
  <VDatePicker v-model="date">
    <template #footer>
      <VButton variant="ghost" tone="neutral" size="sm" @click="inDays(0)">Today</VButton>
      <VButton variant="ghost" tone="neutral" size="sm" @click="inDays(1)">Tomorrow</VButton>
      <VButton variant="ghost" tone="neutral" size="sm" @click="inDays(7)">In a week</VButton>
    </template>
  </VDatePicker>
</template>

Disabled dates

disabledDates accepts ISO dates or a predicate. Unavailable days remain visible and reachable with the keyboard.

vue
a predicate
MonTueWedThuFriSatSun
a list
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker, VTypography } from 'vectis-ui'

const appointment = ref('2026-06-16')
const holiday = ref('2026-06-16')

function isWeekend(iso: string) {
  const day = new Date(`${iso}T00:00:00`).getDay()
  return day === 0 || day === 6
}

const closedDays = ['2026-06-11', '2026-06-12', '2026-06-25']
</script>

<template>
  <div class="row">
    <div class="group">
      <VTypography variant="overline" tone="muted">a predicate</VTypography>
      <VDatePicker v-model="appointment" :disabled-dates="isWeekend" />
    </div>

    <div class="group">
      <VTypography variant="overline" tone="muted">a list</VTypography>
      <VDatePicker v-model="holiday" :disabled-dates="closedDays" />
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--vectis-space-6);
}
.group {
  display: grid;
  gap: var(--vectis-space-2);
}
</style>

Minimum and maximum

min and max restrict both selection and calendar navigation.

vue
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker } from 'vectis-ui'

const date = ref('2026-06-15')
</script>

<template>
  <VDatePicker v-model="date" min="2026-06-05" max="2026-06-24" />
</template>

Event dots

Mark events with coloured dots. Their labels are included in the day’s accessible name.

vue
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker, type DatePickerEvent } from 'vectis-ui'

const date = ref('2026-06-10')

const events: DatePickerEvent[] = [
  { date: '2026-06-10', label: 'Kick-off' },
  { date: '2026-06-18', color: 'var(--vectis-color-danger)', label: 'Deadline' },
  { date: '2026-06-18', color: 'var(--vectis-color-warning)', label: 'Review' },
  { date: '2026-06-24', color: 'var(--vectis-color-success)', label: 'Release' },
]
</script>

<template>
  <VDatePicker v-model="date" :events="events" />
</template>

Adjacent days

Show neighbouring days with showAdjacentDays. Enable their selection with selectAdjacentDays.

vue
hidden, the default
MonTueWedThuFriSatSun
shown
MonTueWedThuFriSatSun
1
2
3
4
5
6
7
8
9
10
11
12
shown and choosable
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker, VTypography } from 'vectis-ui'

const hidden = ref('2026-06-10')
const shown = ref('2026-06-10')
const selectable = ref('2026-06-10')
</script>

<template>
  <div class="row">
    <div class="group">
      <VTypography variant="overline" tone="muted">hidden, the default</VTypography>
      <VDatePicker v-model="hidden" />
    </div>

    <div class="group">
      <VTypography variant="overline" tone="muted">shown</VTypography>
      <VDatePicker v-model="shown" show-adjacent-days />
    </div>

    <div class="group">
      <VTypography variant="overline" tone="muted">shown and choosable</VTypography>
      <VDatePicker v-model="selectable" select-adjacent-days />
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--vectis-space-6);
}
.group {
  display: grid;
  gap: var(--vectis-space-2);
}
</style>

Localization

locale sets month names and week start. firstDayOfWeek overrides the week start.

vue
en-US, weeks from Sunday
SunMonTueWedThuFriSat
fr-FR, weeks from Monday
lun.mar.mer.jeu.ven.sam.dim.
ja-JP
日月火水木金土
en-US, weeks forced to Monday
MonTueWedThuFriSatSun
<script setup lang="ts">
import { ref } from 'vue'
import { VDatePicker, VTypography } from 'vectis-ui'

const locales = ref([
  { tag: 'en-US', caption: 'en-US, weeks from Sunday', date: '2026-06-10' },
  { tag: 'fr-FR', caption: 'fr-FR, weeks from Monday', date: '2026-06-10' },
  { tag: 'ja-JP', caption: 'ja-JP', date: '2026-06-10' },
])

const forced = ref('2026-06-10')
</script>

<template>
  <div class="row">
    <div v-for="locale in locales" :key="locale.tag" class="group">
      <VTypography variant="overline" tone="muted">{{ locale.caption }}</VTypography>
      <VDatePicker v-model="locale.date" :locale="locale.tag" />
    </div>

    <div class="group">
      <VTypography variant="overline" tone="muted">en-US, weeks forced to Monday</VTypography>
      <VDatePicker v-model="forced" locale="en-US" :first-day-of-week="1" />
    </div>
  </div>
</template>

<style scoped>
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--vectis-space-6);
}
.group {
  display: grid;
  gap: var(--vectis-space-2);
}
</style>

API

Props

PropTypeDefault
selectionDatePickerSelection'single' | 'range' | 'multiple''single'
Selection mode: one date, a range or several dates.
localestringnone
BCP 47 locale for date display and week start. Overrides the global locale.
firstDayOfWeeknumbernone
First weekday, from 0 (Sunday) to 6 (Saturday). Defaults to the locale.
minstringnone
Earliest selectable date, in YYYY-MM-DD format. Also limits navigation.
maxstringnone
Latest selectable date, in YYYY-MM-DD format. Also limits navigation.
disabledDatesDatePickerMatchernone
Unavailable dates: an array of ISO strings or a predicate. Days remain visible and reachable with the keyboard.
showAdjacentDaysbooleanfalse
Shows days from neighbouring months.
selectAdjacentDaysbooleanfalse
Allows selecting days from neighbouring months and navigates to that month. Implies showAdjacentDays.
eventsDatePickerEvent[]none
Events shown as up to three dots per day. Each accepts a date, CSS colour and accessible label.
disabledbooleanfalse
Disables selection and navigation.
readonlybooleanfalse
Prevents selection. Month and year navigation remain available.
labelstringnone
Accessible name of the calendar. Defaults to the dictionary; consumer aria-label takes precedence.
v-modelDatePickerValuenull
ISO date or null for single selection, { start, end } for a range, ISO date array for multiple selection.

Events

EventType
select[value: DatePickerValue]
A date was selected. Receives the current model, including an incomplete range.

Slots

SlotType
dayDatePickerDaySlotProps
Day cell content. Receives iso, day, inMonth, disabled, selected, today, inRange and events.
footer{}
Actions or preset dates below the grid.

Types

Types used in the API tables. Import exported types from vectis-ui.

export interface DatePickerDaySlotProps {
  iso: string
  day: number
  inMonth: boolean
  disabled: boolean
  selected: boolean
  today: boolean
  inRange: boolean
  events: DatePickerEvent[]
}
export interface DatePickerEvent {
  date: string
  color?: string
  label?: string
}
export type DatePickerMatcher = string[] | ((iso: string) => boolean)
export interface DatePickerRange {
  start: string | null
  end: string | null
}
export type DatePickerValue = string | null | DatePickerRange | string[]

CSS variables

TokenValue
--vectis-control-size-date-picker-cell2.5rem
--vectis-control-size-date-picker-dayvar(--vectis-control-height-md)
--vectis-control-size-date-picker-dot0.25rem
--vectis-control-size-date-picker-nav-min5.375rem