year-month-picker
v2.0.1
Published
React component for selecting year and month with smooth animations and customizable UI.
Readme
Year Month Picker Library
A customizable React component for selecting year and month. Built with TailwindCSS and works seamlessly with popovers and headless UI libraries.
Installation
npm install year-month-pickerBasic Usage
import { YmPicker } from "year-month-picker";
export default function Demo() {
return <YmPicker mode="year-month" onSelect={(ym) => console.log(ym)} />;
}Documentation
Visit https://year-month-picker.vercel.app/ to view the documentation.
API Reference
| 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 | - |
