Examples
These examples show the styled wrapper in its default plain-CSS presentation and in a theme-aware Tailwind shell across common use cases.
Form usage
Yearpicker fits naturally into forms where a fiscal year, report year, or model year is a single submitted field.
Yearpicker form usage
Default wrapper
Stock behavior with editable YYYY input and a year grid popup that closes automatically on selection.
Default wrapper (Plain-CSS)
The default wrapper picks up the theme contract without extra utility classes.
Default wrapper (Tailwind CSS)
Tailwind can own the outer surface while semantic tokens keep light, dark, and custom themes in sync.
Bounded range
minYear and maxYear constrain the year grid cells and keyboard navigation.
Bounded range (Plain-CSS)
Years outside the bounded window are rendered as disabled cells.
Bounded range (Tailwind CSS)
Disabled state
The entire field — input, trigger, and year grid — is inert when disabled is true.
Disabled state (Plain-CSS)
Disabled styling flows through the [data-disabled] state hook on the host and year cells.