Every example is a complete Vue file. Copy it into an app that has the registry installed, or open it in StackBlitz. Click a day, or Tab into the grid and use the arrow keys.
Days that can’t be picked
A delivery date: days before today are disabled with min-value, and Sundays are unavailable with is-date-unavailable. Unavailable days are struck through, so they are not marked by colour alone.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
Delivery on Thursday, December 3, 2026. No deliveries on Sundays.
<script setup lang="ts">
import type { DateValue } from '@internationalized/date'
import type { Ref } from 'vue'
import { DateFormatter, getLocalTimeZone, today } from '@internationalized/date'
import { ref } from 'vue'
import { Calendar } from '@/components/ui/calendar'
// Pick a delivery date: from today on, and never on a Sunday, when the warehouse is closed.
const start = today(getLocalTimeZone())
const value = ref(start.add({ days: 2 })) as Ref<DateValue>
const isSunday = (date: DateValue) => date.toDate(getLocalTimeZone()).getDay() === 0
const format = new DateFormatter('en-US', { dateStyle: 'full' })
</script>
<template>
<div class="grid justify-items-start gap-(--bh-space-100)">
<Calendar
v-model="value"
:min-value="start"
:is-date-unavailable="isSunday"
class="rounded-(--bh-radius-card) border-(length:--bh-border-width-default) border-(--bh-color-border)"
/>
<p class="text-(--bh-color-text-subtle) [font:var(--bh-font-body-default)]">
Delivery on {{ value ? format.format(value.toDate(getLocalTimeZone())) : 'no date yet' }}. No deliveries on Sundays.
</p>
</div>
</template>Date picker
A button that shows the date and opens the calendar in a popover. Picking a day closes it and focus returns to the button.
<script setup lang="ts">
import type { DateValue } from '@internationalized/date'
import { DateFormatter, getLocalTimeZone } from '@internationalized/date'
import { CalendarDays } from '@lucide/vue'
import { ref } from 'vue'
import { Button } from '@/components/ui/button'
import { Calendar } from '@/components/ui/calendar'
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'
// A date picker: a button that opens a calendar in a popover. Picking a day closes it.
const open = ref(false)
const value = ref<DateValue>()
const format = new DateFormatter('en-US', { dateStyle: 'medium' })
function pick(date: DateValue | undefined) {
value.value = date
open.value = false
}
</script>
<template>
<div class="grid justify-items-start gap-(--bh-space-050)">
<span id="due-date-label" class="text-(--bh-color-text) [font:var(--bh-font-label-default)]">Invoice due date</span>
<Popover v-model:open="open">
<PopoverTrigger as-child>
<Button variant="outline" aria-labelledby="due-date-label due-date-value">
<CalendarDays />
<span id="due-date-value">{{ value ? format.format(value.toDate(getLocalTimeZone())) : 'Pick a date' }}</span>
</Button>
</PopoverTrigger>
<PopoverContent class="w-auto p-0" align="start">
<Calendar :model-value="value" initial-focus @update:model-value="pick" />
</PopoverContent>
</Popover>
</div>
</template>Month and year pickers
layout="month-and-year" puts a month and a year select in the header, for dates that can be years away, such as a contract start date.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
<script setup lang="ts">
import type { DateValue } from '@internationalized/date'
import type { Ref } from 'vue'
import { CalendarDate } from '@internationalized/date'
import { ref } from 'vue'
import { Calendar } from '@/components/ui/calendar'
// A contract start date can be years away, so the header has month and year pickers.
const value = ref(new CalendarDate(2025, 4, 1)) as Ref<DateValue>
</script>
<template>
<Calendar
v-model="value"
layout="month-and-year"
:min-value="new CalendarDate(2015, 1, 1)"
:max-value="new CalendarDate(2030, 12, 31)"
class="rounded-(--bh-radius-card) border-(length:--bh-border-width-default) border-(--bh-color-border)"
/>
</template>