DatePickerYears

Form & Input
stable

Scrollable year list for picking a year. Renders years in a 3-column grid from min to max (defaulting to ±100 years from today). Auto-scrolls to the selected year on mount.

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamDatePickerYearsSchematic of the DatePickerYears component showing a scrollable 3-column grid of year buttons. 2020 2021 2022 2023 2024 2025 2026 2026 2027 2028 2029 2030 … scrollable 1 2 3
Anatomy of <origam-date-picker-years> — 3 parts: ① root scroll container (288px height, overflow-y: scroll), ② 3-column grid content wrapper, ③ the active year button. On mount, the selected year scrolls into view via scrollIntoView({block: 'center'}).
1.origam-date-picker-years
Root container. Height 288px (default), overflow-y: scroll. Enables native browser scrolling to the selected year.
2.origam-date-picker-years__content
3-column CSS grid with justify-content: space-around. gap: 8px 24px. padding-inline: 32px. Inner OrigamBtn have padding-inline: 8px.
3OrigamBtn (active)
The selected year button. Receives active=true and color=props.color. All buttons have rounded=true. The active button is also assigned a template ref so scrollIntoView can target it on mount.

API

Props

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.

min
unknown
currentYear - 100
Minimum year to include in the list. Derived from the year portion of the min date. Defaults to 100 years before today.
max
unknown
currentYear + 52
Maximum year to include in the list. Derived from the year portion of the max date. Defaults to 52 years after today.
year
number
Currently selected year. The matching tile is highlighted and auto-scrolled into view on mount.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Intent or custom colour applied to the selected year button.
height
number | string
288px
Height of the years container. Overflow-y: scroll enables the virtual scroll. Defaults to 288px.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string

API

Slots

Emplacements de contenu exposés par ce composant.

#year
Custom year tile. Slot props expose the year descriptor ({ text, value }), its grid index, and the bound button props (active, color, rounded, text, onClick).

API

Emits

Événements émis par ce composant.

@update:year
number
Fired when a year tile is clicked. Payload is the four-digit year.

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. Overflow-y: scroll. 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

button

Interactions clavier

Interactions clavier
ToucheAction
Enter / SpaceSelects the focused year.
TabMoves focus between year tiles.

Notes

  • On mount, the selected year is automatically scrolled into the centre of the visible area via scrollIntoView({block: "center"}), so users do not need to scroll manually to find the current year.

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.

Source
color
var(--origam-color__action--primary---bg)
Active year 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 year picker

vue

Bounded year list

vue

Écosystème

Famille

Composants du même dossier qui partagent les conventions et se composent souvent ensemble.