year-selector
v0.0.5
Published
Select a year in the past or future
Readme
React Year Selector
A minimal library to select a year without selecting month or day Storybook preview.
The latest version is not yet finalised and is subject to change, open an issue if you come across a problem in usage
Installation
npm i year-selectorBasic usage
import { YearSelector } from "year-selector";
<YearSelector
label="Year of birth"
placeholder="YYYY"
contentClasses="max-w-[90vw] p-4 md:grid-cols-5 lg:grid-cols-6"
fromYear={1993}
toYear={2024}
value={value?.toString()}
onChange={onChange}
/>;Limitations
- If no
toYearis passed, uses current year astoYear - If no
fromYearis passed uses1900
