Appearance
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>| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | string | Date | Array<string | Date> | undefined | Selected date(s) |
multiple | boolean | number | string | false | Allow selecting multiple dates. A number caps how many dates may be selected |
range | boolean | false | Allow 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:
| Gesture | Behaviour |
|---|---|
| click | Selects that day alone (whatever multiple / range are set to) |
Ctrl/Cmd + click, with multiple | Toggles that day in/out of the selection |
Shift + click, with multiple or range | Extends to a contiguous range |
When multiple is a number, every unselected day is disabled once that many dates are selected.
Navigation constraints
vue
<template>
<OrigamDatePicker v-model="date" min="2024-01-01" max="2024-12-31" />
</template>| Prop | Type | Description |
|---|---|---|
min | unknown | Earliest selectable date — anything the active date adapter accepts (ISO 8601 string, Date, …) |
max | unknown | Latest selectable date — same accepted shapes as min |
month | number | Override the displayed month (0–11) |
year | number | Override the displayed year |
View mode
| Prop | Type | Default | Description |
|---|---|---|---|
viewMode | TDateMode | 'month' | Active view: 'month' | 'months' | 'years' |
showWeek | boolean | false | Show week numbers alongside the grid |
weeksInMonth | TCalendarStrategy | '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>| Prop | Type | Default | Description |
|---|---|---|---|
text | string | undefined | Label of the toolbar's month button. When unset — or empty — the adapter-formatted month name is shown |
yearText | string | undefined | Label 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.
Navigation flow
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
| Prop | Type | Description |
|---|---|---|
disabled | boolean | Disable all controls |
disabledMonth | boolean | Disable the month button |
disabledYear | boolean | Disable the year button |
disabledNext | boolean | Disable the "next month" arrow |
disabledPrev | boolean | Disable the "previous month" arrow |
Slots
| Slot | Bindings | Description |
|---|---|---|
title | — | Custom title area |
header | { header, transition } | Full header override |
default | — | Replaces the entire picker body |
actions | — | Footer actions (confirm / cancel) |
Emits
| Event | Payload | Description |
|---|---|---|
update:modelValue | string | Date | Array<...> | Fires when the date selection changes |
update:month | number | Fires when the displayed month changes |
update:year | number | Fires when the displayed year changes |
update:viewMode | TDateMode | Fires when the view mode switches |
Design tokens
| Token | Default | Description |
|---|---|---|
--origam-date-picker---width | 328px | Width of the picker |
--origam-date-picker--show-week---width | 368px | Width 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.