Skip to content

OrigamDatePicker ​

<OrigamDatePicker> is a self-contained calendar widget. It supports single date, multiple dates, and range selection. The view can be navigated across days, months, and years.

Basic usage ​

vue
<template>
    <OrigamDatePicker v-model="date" />
</template>

<script setup>
import { ref } from 'vue'
const date = ref(null)
</script>

Selection modes ​

vue
<template>
    <!-- Range selection -->
    <OrigamDatePicker v-model="dates" range />
    <!-- Multiple selection -->
    <OrigamDatePicker v-model="dates" multiple />
</template>
PropTypeDefaultDescription
modelValuestring | Date | Array<string | Date>undefinedSelected date(s)
multipleboolean | number | stringfalseAllow selecting multiple dates. A number caps how many dates may be selected
rangebooleanfalseAllow selecting a date range (start + end)

Keyboard modifiers are required ​

multiple and range do not change what a plain click does — a click with no modifier always replaces the selection with the single day clicked. The modifiers are read in <OrigamDatePickerMonth>'s click handler:

GestureBehaviour
clickSelects that day alone (whatever multiple / range are set to)
Ctrl/Cmd + click, with multipleToggles that day in/out of the selection
Shift + click, with multiple or rangeExtends to a contiguous range

When multiple is a number, every unselected day is disabled once that many dates are selected.

vue
<template>
    <OrigamDatePicker v-model="date" min="2024-01-01" max="2024-12-31" />
</template>
PropTypeDescription
minunknownEarliest selectable date — anything the active date adapter accepts (ISO 8601 string, Date, …)
maxunknownLatest selectable date — same accepted shapes as min
monthnumberOverride the displayed month (0–11)
yearnumberOverride the displayed year

View mode ​

PropTypeDefaultDescription
viewModeTDateMode'month'Active view: 'month' | 'months' | 'years'
showWeekbooleanfalseShow week numbers alongside the grid
weeksInMonthTCalendarStrategy'static'Week-count strategy

Controls labels ​

The toolbar has two buttons: month (opens the months grid) and year (opens the years grid). They show the displayed month name and year, formatted by the active date adapter (month / year). text replaces the month label and yearText the year label with your own strings. The chevron of the button whose grid is open flips upwards.

vue
<template>
    <OrigamDatePicker v-model="date" text="Période" year-text="Année" />
</template>
PropTypeDefaultDescription
textstringundefinedLabel of the toolbar's month button. When unset — or empty — the adapter-formatted month name is shown
yearTextstringundefinedLabel of the toolbar's year button. When unset — or empty — the adapter-formatted year is shown

An empty string falls back to the formatted value rather than blanking the label: those buttons are the only place the user reads which month and year are on screen.

Year → month → day: picking a year opens the months grid, picking a month opens the day grid. The previous / next arrows are active on the day grid only and are disabled while the months or years grid is open.

Behaviour change (#1365)

text used to label the whole "June 2024" button; it now labels the month button only, the year having its own button (yearText). The single month + year button and the separate chevron toggle are gone.

Fixed until v3.0.0

text was declared but unreachable: a module-scope const text masked it, so <OrigamDatePicker text="…"> was silently ignored (#700). Consumers written against the broken behaviour that pass text will now see their own label instead of the month + year.

Disabled controls ​

PropTypeDescription
disabledbooleanDisable all controls
disabledMonthbooleanDisable the month button
disabledYearbooleanDisable the year button
disabledNextbooleanDisable the "next month" arrow
disabledPrevbooleanDisable the "previous month" arrow

Slots ​

SlotBindingsDescription
title—Custom title area
header{ header, transition }Full header override
default—Replaces the entire picker body
actions—Footer actions (confirm / cancel)

Emits ​

EventPayloadDescription
update:modelValuestring | Date | Array<...>Fires when the date selection changes
update:monthnumberFires when the displayed month changes
update:yearnumberFires when the displayed year changes
update:viewModeTDateModeFires when the view mode switches

Design tokens ​

TokenDefaultDescription
--origam-date-picker---width328pxWidth of the picker
--origam-date-picker--show-week---width368pxWidth applied instead when showWeek is on

Both are declared in packages/ds/src/assets/css/tokens/light.css and its dark.css twin, and read by the .origam-date-picker / .origam-date-picker--show-week rules. Override them on any ancestor to re-size every picker at once.