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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #days
- Custom day cell content. Slot props expose the click handler (props.onClick), the day descriptor (item: IDay) and its grid index.
API
Emits
Events emitted by this component.
- @update:dateReadonlyArray<unknown> | Array<unknown>
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | 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.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- 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.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Standalone month grid
Range selection
Custom day cell via #days slot
Ecosystem
Family
Components from the same folder that share conventions and often compose together.
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.