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

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

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

All props accepted by this component, with their type, default value and 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

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:date
ReadonlyArray<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

gridcell
button

Keyboard interactions

Keyboard interactions
KeyAction
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.

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.

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.

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

vue

Range selection

vue

Custom day cell via #days slot

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.