A customizable React component for selecting year and month. Built with TailwindCSS and works seamlessly with popovers and headless UI libraries.
npm install year-month-pickerimport { YmPicker } from "year-month-picker";
export default function Demo() {
return <YmPicker mode="year-month" onSelect={(ym) => console.log(ym)} />;
}Visit https://year-month-picker.vercel.app/ to view the documentation.
| Prop | Type | Default |
|---|---|---|
| mode | "year-month" | "year" | "month" |
"year" |
| ym | {year: number | null, month: number | null} | — |
| onSelect | ({year: number | null, month: number | null}) => void | — |
| message | string | Select date |
| container | React.HTMLAttributes | — |
| header | React.HTMLAttributes | - |
| yearGrid | React.HTMLAttributes | - |
| monthGrid | React.HTMLAttributes | - |
| button | React.HTMLAttributes | - |