Inline date selection
Keep a date grid visible when choosing a date is the main task.
Components / Forms
An inline keyboard-accessible single-date or date-range calendar.
Last changed in version 0.14.2: Improve keyboard navigation, action feedback, and selected colors across Vue components.
bunx --bun @getweini/cli@latest add calendarImport the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.
<script setup lang="ts">
import { ref } from 'vue'
import Calendar from './components/ui/calendar/Calendar.vue'
const date = ref('2026-10-12')
const range = ref<[string, string]>(['2026-10-12', '2026-10-16'])
const messages = { previousMonth: 'Previous month', nextMonth: 'Next month' }
</script>
<template>
<Calendar v-model="date" :messages="messages" />
<Calendar v-model="range" mode="range" :messages="messages" />
</template>Arrow keys move by day or week; Home/End jump to week edges and Page Up/Down change months. Range mode uses the same continuous selection band as DatePickerRange and emits an empty end until the second date is selected.
Keep a date grid visible when choosing a date is the main task.
Let users choose start and end dates directly in a page without opening a popover.
Locale changes labels; firstDayOfWeek separately controls the week grid.
<script setup lang="ts">
import { ref } from 'vue'
import Calendar from './components/ui/calendar/Calendar.vue'
const usDate = ref('2026-10-12')
const frenchDate = ref('2026-10-12')
const english = { previousMonth: 'Previous month', nextMonth: 'Next month' }
const french = { previousMonth: 'Mois précédent', nextMonth: 'Mois suivant' }
</script>
<template>
<section aria-label="US event date">
<Calendar v-model="usDate" locale="en-US" :first-day-of-week="0" :messages="english" />
</section>
<section aria-label="Date de l’événement">
<Calendar v-model="frenchDate" locale="fr-FR" :first-day-of-week="1" :messages="french" />
</section>
</template>The second tuple entry stays empty until the end date is chosen.
<script setup lang="ts">
import { ref } from 'vue'
import Calendar from './components/ui/calendar/Calendar.vue'
const range = ref<[string, string]>(['', ''])
const messages = { previousMonth: 'Previous month', nextMonth: 'Next month' }
</script>
<template>
<section aria-label="Available dates">
<Calendar
v-model="range"
mode="range"
min="2026-10-01"
max="2026-12-31"
locale="en-GB"
:first-day-of-week="1"
:messages="messages"
/>
</section>
<p v-if="range[0]">Start:{{ range[0] }}; end:{{ range[1] || 'choose an end date' }}</p>
</template>Keep the chosen local date and IANA zone separate; an existing instant can be displayed in that zone with Intl.
<script setup lang="ts">
import { computed, ref } from 'vue'
import Calendar from './components/ui/calendar/Calendar.vue'
const localDate = ref('2026-10-12')
const timeZone = ref('Europe/Luxembourg')
const existingInstant = ref('2026-10-12T13:00:00Z')
const messages = { previousMonth: 'Previous month', nextMonth: 'Next month' }
const existingLocalTime = computed(() =>
new Intl.DateTimeFormat('en-GB', {
dateStyle: 'medium',
timeStyle: 'short',
timeZone: timeZone.value,
}).format(new Date(existingInstant.value)),
)
const schedulingInput = computed(() => ({ localDate: localDate.value, timeZone: timeZone.value }))
</script>
<template>
<section aria-label="Meeting date">
<Calendar v-model="localDate" locale="en-GB" :first-day-of-week="1" :messages="messages" />
</section>
<p>Chosen date: {{ schedulingInput.localDate }} in {{ schedulingInput.timeZone }}</p>
<p>Existing appointment in that zone: {{ existingLocalTime }}</p>
</template>These calendars share one selected YYYY-MM-DD date. Locale changes the displayed month and day names; firstDayOfWeek changes the grid. The underlying date value remains the same. Calendar renders Gregorian dates; setting a locale does not switch calendar systems.
Selected date: 2026-10-12
An event at 2026-10-12T23:30:00Z lands on different local dates. Calendar does not convert instants; choose and store an IANA time zone in your application when scheduling events. This demonstration compares America/New_York, Europe/Luxembourg, and Asia/Tokyo using Intl.DateTimeFormat.
Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
referenceDateprop | string | undefined | Not set | Serialized civil date shared by server and client for deterministic initial rendering. |
modeprop | "single" | "range" | undefined | "single" | Choose the selection or display mode. |
minprop | string | undefined | Not set | Smallest allowed value. |
maxprop | string | undefined | Not set | Largest allowed value. |
disabledprop | boolean | undefined | Not set | Prevent interaction and show the disabled state. |
readonlyprop | boolean | undefined | Not set | Show the value while preventing edits. |
localeprop | string | undefined | Not set | Choose the language and regional formatting for dates or text. |
firstDayOfWeekprop | 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined | 1 | Choose which weekday begins each calendar row. |
messagesprop | CalendarMessages | Required | Supply the text this component displays for its built-in actions and states. |
modelValuemodel | CalendarValue | undefined | Not set | Current value. Use v-model to keep it in sync with your page. |
update:modelValueevent | [value: CalendarValue | undefined] | — | Requests a new model value from the parent. |
elementexposed | HTMLElement | null | — | Reference to the underlying HTML element. |
focusexposed | () => void | undefined | — | Move keyboard focus to this control. |
// packages/frameworks/vue/components/calendar/types.ts
export type CalendarRange = [start: string, end: string]
export type CalendarValue = string | CalendarRange
export interface CalendarMessages {
previousMonth: string
nextMonth: string
}
export interface CalendarProps {
/** Serialized civil date shared by server and client for deterministic initial rendering. */
referenceDate?: string
mode?: 'single' | 'range'
min?: string
max?: string
disabled?: boolean
readonly?: boolean
locale?: string
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6
messages: CalendarMessages
}