DatePickerMonth

Form & Input
stable

Day-grid view for picking a date within the current month. Renders weekday labels and day buttons with single, multiple and range selection support.

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamDatePickerMonthSchematic of the DatePickerMonth component showing weekday labels, day cells and week numbers column. Wk 22 23 24 25 26 Lu Ma Me Je Ve Sa Di 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 1 2 3 4
Anatomy of <origam-date-picker-month> — 4 parts: ① root wrapper, ② week-numbers column (showWeek), ③ weekday header row, ④ day button cells.
1.origam-date-picker-month
Root flex container. Display: flex, padding: 0 12px 8px. Hosts the weeks column and the days grid side by side.
2.origam-date-picker-month__weeks
Optional week-numbers column. Visible when showWeek=true. Uses grid-template-rows: repeat(7, 1fr).
3.origam-date-picker-month__weekday
Weekday label cell (Mon, Tue…). Font-size 0.85rem. Hidden when hideWeekdays=true.
4.origam-date-picker-month__day
Day cell. 40×40px. Contains the day button. Modifiers: --selected, --today, --adjacent, --hide-adjacent, --week-start, --week-end.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

hideWeekdays
boolean
false
Hides the weekday label row (Mon, Tue…) above the day grid.
multiple
boolean | number | TAnyString
false
Enables multi-date selection. Pass a number to cap the maximum selectable dates.
range
boolean
false
Enables date-range selection mode. Shift-click selects the range; Ctrl/Cmd-click adds individual dates.
showWeek
boolean
false
Shows ISO week numbers in an extra column on the left of the grid.
transition
TTransitionProps
OrigamTranslatePicker
Enter transition when navigating forward through months.
reverseTransition
TTransitionProps
OrigamReverseTranslatePicker
Enter transition when navigating backward through months.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Intent or custom colour used for the selected day button background.
allowedDates
Array<unknown> | ((date: unknown) => boolean)
Allowlist of selectable dates. Pass an array or a predicate function — other days are disabled.
disabled
boolean
displayValue
unknown
date
ReadonlyArray<unknown> | Array<unknown>
Array of currently selected dates. Passed down from the parent DatePicker model.
month
number
Zero-based month index (0 = January, 11 = December) currently displayed.
max
unknown
Maximum selectable date. Days after this value are rendered as disabled.
min
unknown
Minimum selectable date. Days before this value are rendered as disabled.
showAdjacentMonths
boolean
false
Shows days from the previous and next months in the first and last rows. Adjacent days are faded (opacity: 0.5).
year
number
Four-digit year currently displayed.
weekdays
Array<number>
[0, 1, 2, 3, 4, 5, 6]
Array of day indices (0 = Sunday) that define the column order of the grid.
weeksInMonth
TCalendarStrategy
'dynamic'
Strategy for row count: 'dynamic' adapts to the month (4–6 rows); 'static' always renders 6 rows.
firstDayOfWeek
number
First day of the week (0 = Sunday, 1 = Monday…). Defaults to the locale setting.

API

Slots

Emplacements de contenu exposés par ce composant.

#days
Custom day cell content. Slot props expose the click handler (props.onClick), the day descriptor (item: IDay) and its grid index.

API

Emits

Événements émis par ce composant.

@update:date
ReadonlyArray<unknown> | Array<unknown>

API

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to child components.
Ref<string>
Reactive CSS string generated by useStyle.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document.
() => void
Removes the injected style sheet from the document.
Ref<boolean>
True once the style sheet has been injected.

Personnalisation

Variables CSS

Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.

Gap used to offset the range-selection pseudo-element (::before/::after) on selected day cells.
Height of the inner day button (overridden from the default btn height via :deep selector).

Inclusion

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Rôles ARIA

gridcell
button

Interactions clavier

Interactions clavier
ToucheAction
Enter / SpaceSelects the focused day.
Shift + ClickSelects a date range when multiple or range prop is active.
Ctrl / Cmd + ClickAdds or removes a date from the selection when multiple is active.

Notes

  • Disabled day buttons receive the disabled attribute. Days outside the allowed range are also disabled.
  • Today's cell receives border=true on the inner button, providing a visual ring without relying solely on colour.

Fondation

Design tokens

Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.

Source
dimension
40px
Day cell size (height and width).
color
var(--origam-color__action--primary---bg)
Selected day background colour.
color
var(--origam-color__surface---overlay)
Background of cells within a date-range selection.

Interactif

Playground

Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.

Rendu de l’aperçu en cours…

Usage

Exemples

Extraits de code prêts à coller dans vos templates.

Standalone month grid

vue

Range selection

vue

Custom day cell via #days slot

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.