Fork of react-tailwindcss-datepicker to improve styles and fix bugs
npm install jibba-tw-datepicker
Fixes react tailwindcss datepicker for tailwind v4 and adds more style
npm install react-tailwindcss-datepicker
`
$3
`
yarn add react-tailwindcss-datepicker
`
Make sure you have installed the peer dependencies as well with the below versions.
`
"dayjs": "^1.11.6",
"react": "^17.0.2 || ^18.2.0"
`
Simple Usage
#### Tailwindcss Configuration
Add the datepicker to your tailwind configuration using this code
`javascript
// in your tailwind.config.js
module.exports = {
// ...
content: [
"./src/*/.{js,jsx,ts,tsx}",
"./node_modules/react-tailwindcss-datepicker/dist/index.esm.js"
]
// ...
};
`
Then use react-tailwindcss-select in your app:
`tsx
import { useState } from "react";
import Datepicker from "react-tailwindcss-datepicker";
const App = () => {
const [value, setValue] = useState({
startDate: null,
endDate: null
});
return (
<>
setValue(newValue)} />
>
);
};
export default App;
``