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
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @update:monthnumber
- Fired when a month tile is clicked. Payload is the 0-based month index.
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.
- 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.
- Container height. Overridden via the height prop (IDimensionProps).
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 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.
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.
- colorvar(--origam-color__action--primary---bg)
- Active month button background (driven by the color prop).
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 picker
With min/max constraints
É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.
DatePickerMonth
Day-grid view for picking a date within the current month.
DatePickerYears
Scrollable year list for picking a year.