DatePickerMonth
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.
<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.
- hideWeekdaysbooleanfalse
- Hides the weekday label row (Mon, Tue…) above the day grid.
- multipleboolean | number | TAnyStringfalse
- Enables multi-date selection. Pass a number to cap the maximum selectable dates.
- rangebooleanfalse
- Enables date-range selection mode. Shift-click selects the range; Ctrl/Cmd-click adds individual dates.
- showWeekbooleanfalse
- Shows ISO week numbers in an extra column on the left of the grid.
- transitionTTransitionPropsOrigamTranslatePicker
- Enter transition when navigating forward through months.
- reverseTransitionTTransitionPropsOrigamReverseTranslatePicker
- Enter transition when navigating backward through months.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom colour used for the selected day button background.
- allowedDatesArray<unknown> | ((date: unknown) => boolean)
- Allowlist of selectable dates. Pass an array or a predicate function — other days are disabled.
- disabledboolean
- displayValueunknown
- dateReadonlyArray<unknown> | Array<unknown>
- Array of currently selected dates. Passed down from the parent DatePicker model.
- monthnumber
- Zero-based month index (0 = January, 11 = December) currently displayed.
- maxunknown
- Maximum selectable date. Days after this value are rendered as disabled.
- minunknown
- Minimum selectable date. Days before this value are rendered as disabled.
- showAdjacentMonthsbooleanfalse
- Shows days from the previous and next months in the first and last rows. Adjacent days are faded (opacity: 0.5).
- yearnumber
- Four-digit year currently displayed.
- weekdaysArray<number>[0, 1, 2, 3, 4, 5, 6]
- Array of day indices (0 = Sunday) that define the column order of the grid.
- weeksInMonthTCalendarStrategy'dynamic'
- Strategy for row count: 'dynamic' adapts to the month (4–6 rows); 'static' always renders 6 rows.
- firstDayOfWeeknumber
- 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:dateReadonlyArray<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
Interactions clavier
| Touche | Action |
|---|---|
| Enter / Space | Selects the focused day. |
| Shift + Click | Selects a date range when multiple or range prop is active. |
| Ctrl / Cmd + Click | Adds 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.
- dimension40px
- Day cell size (height and width).
- colorvar(--origam-color__action--primary---bg)
- Selected day background colour.
- colorvar(--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
Range selection
Custom day cell via #days slot
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.
DatePicker
Calendar popup to select a single date, multiple dates or a range.
DatePickerControls
Navigation bar with prev/next and view-mode toggle buttons.
DatePickerHeader
Coloured header strip showing the selected date or month.
DatePickerMonths
Month-grid view for picking a month within the current year.
DatePickerYears
Scrollable year list for picking a year.