DatePickerMonths
Month-grid view for picking a month within a given year. Renders 12 month buttons in a 2-column grid with min/max constraint support.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-date-picker-months> — 3 parts: ① root container (288px default height), ② the 2-column grid content wrapper, ③ the active month button highlighted with the color prop.- 1.origam-date-picker-months
- Root container. Fixed height (288px by default). Overflow hidden.
- 2.origam-date-picker-months__content
- 2-column CSS grid with justify-content: space-around. padding-inline: 36px. grid-gap: 0 24px. Inner OrigamBtn elements have text-transform: none.
- 3OrigamBtn (active)
- The currently selected month button. Receives active=true and color=props.color. All buttons have rounded=true.
API
Props
All props accepted by this component, with their type, default value and description.
- minunknown
- Minimum selectable date. Months whose end falls before this value are disabled.
- maxunknown
- Maximum selectable date. Months whose start falls after this value are disabled.
- monthnumber
- Currently selected month (0-based: 0 = January). Used to highlight the active tile.
- yearnumber
- Year for which the 12 months are displayed. Changes which months are enabled/disabled against min/max.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Intent or custom colour applied to the active month button.
- heightnumber | string288px
- Height of the months grid container. Defaults to 288px (matches the default DatePicker calendar area height).
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
API
Slots
Content slots exposed by this component.
- #month
- Custom month tile. Slot props expose the month descriptor, its index (0–11) and the bound button props (active, color, disabled, rounded, text, onClick).
API
Emits
Events emitted by this component.
- @update:monthnumber
- Fired when a month tile is clicked. Payload is the 0-based month index.
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.
- 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.
- Container height. Overridden via the height prop (IDimensionProps).
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 month. |
| Tab | Moves focus between month tiles. |
Notes
- Months outside the min/max range receive disabled=true on the inner OrigamBtn and are skipped in keyboard navigation.
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.
- colorvar(--origam-color__action--primary---bg)
- Active month button background (driven by the color prop).
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 picker
With min/max constraints
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.
DatePickerMonth
Day-grid view for picking a date within the current month.
DatePickerYears
Scrollable year list for picking a year.