Package Exports
- react-easepick
- react-easepick/dist/index.js
- react-easepick/dist/module.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-easepick) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-easepick
EasePicker
- a react component based on the easepick library.
Attributes
- date - date value
- startDate - start date (RangePlugin)
- endDate - end date (RangePlugin)
- options - easepick options
- ...inputProps[] - input props
How to Use
Step 1.
npm i react-easepick
Step 2.
import { useMemo, useState } from "react";
import EasePicker, { EasePickOptions } from "react-easepick";
function Demo() {
const [date, setDate] = useState<Date | undefined>();
const options: EasePickOptions = useMemo(
() => ({
css: [
'https://cdn.jsdelivr.net/npm/@easepick/bundle@1.2.0/dist/index.css',
],
setup(picker) {
picker.on("select", (e) => {
const { date } = e.detail;
setDate(date);
});
},
}),
[]
);
return <EasePicker date={date} options={options} />;
}
export default Demo;