Gathering detailed insights and metrics for tailwind-datepicker-react
Gathering detailed insights and metrics for tailwind-datepicker-react
Gathering detailed insights and metrics for tailwind-datepicker-react
Gathering detailed insights and metrics for tailwind-datepicker-react
react-tailwindcss-datepicker
A modern React Datepicker using Tailwind CSS 3
@ivankozlo/react-tailwindcss-datepicker
A modern React Datepicker using Tailwind CSS 3
nloomis_react-tailwindcss-datepicker
A modern React Datepicker using Tailwind CSS 3
tailwind-datepicker-react-updated
A tailwindcss/flowbite datepicker component built as a react component with types
A tailwindcss/flowbite datepicker component built as a react component with types
npm install tailwind-datepicker-react
Typescript
Module System
Node Version
NPM Version
75.5
Supply Chain
89.4
Quality
76
Maintenance
100
Vulnerability
99.6
License
TypeScript (96.77%)
JavaScript (2.39%)
CSS (0.84%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
163 Stars
198 Commits
75 Forks
4 Watchers
3 Branches
22 Contributors
Updated on May 09, 2025
Minified
Minified + Gzipped
Latest Version
1.4.3
Package Id
tailwind-datepicker-react@1.4.3
Unpacked Size
62.30 kB
Size
12.17 kB
File Count
36
NPM Version
10.0.0
Node Version
18.17.0
Published on
Oct 13, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
3
6
A Tailwindcss/Flowbite datepicker component built as a React component with types based on the original datepicker from Flowbite. This component can also be used as a plugin using the Flowbite React library.
Date logic from VanillaJS-datepicker.
1npm install tailwind-datepicker-react
1yarn add tailwind-datepicker-react
tailwind.config.js
file1module.exports = { 2 ... 3 content: [ 4 ... 5 "./node_modules/tailwind-datepicker-react/dist/**/*.js", // <--- Add this line 6 ], 7 8}; 9
1import Datepicker from "tailwind-datepicker-react"
1const options = { 2 title: "Demo Title", 3 autoHide: true, 4 todayBtn: false, 5 clearBtn: true, 6 clearBtnText: "Clear", 7 maxDate: new Date("2030-01-01"), 8 minDate: new Date("1950-01-01"), 9 theme: { 10 background: "bg-gray-700 dark:bg-gray-800", 11 todayBtn: "", 12 clearBtn: "", 13 icons: "", 14 text: "", 15 disabledText: "bg-red-500", 16 input: "", 17 inputIcon: "", 18 selected: "", 19 }, 20 icons: { 21 // () => ReactElement | JSX.Element 22 prev: () => <span>Previous</span>, 23 next: () => <span>Next</span>, 24 }, 25 datepickerClassNames: "top-12", 26 defaultDate: new Date("2022-01-01"), 27 language: "en", 28 disabledDates: [], 29 weekDays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], 30 inputNameProp: "date", 31 inputIdProp: "date", 32 inputPlaceholderProp: "Select Date", 33 inputDateFormatProp: { 34 day: "numeric", 35 month: "long", 36 year: "numeric" 37 } 38} 39 40const DemoComponent = () => { 41 const [show, setShow] = useState < boolean > false 42 const handleChange = (selectedDate: Date) => { 43 console.log(selectedDate) 44 } 45 const handleClose = (state: boolean) => { 46 setShow(state) 47 } 48 49 return ( 50 <div> 51 <Datepicker options={options} onChange={handleChange} show={show} setShow={handleClose} /> 52 </div> 53 ) 54}
1const options = { 2 title: "Demo Title", 3 autoHide: true, 4 todayBtn: false, 5 clearBtn: true, 6 clearBtnText: "Clear", 7 maxDate: new Date("2030-01-01"), 8 minDate: new Date("1950-01-01"), 9 theme: { 10 background: "bg-gray-700 dark:bg-gray-800", 11 todayBtn: "", 12 clearBtn: "", 13 icons: "", 14 text: "", 15 disabledText: "bg-red-500", 16 input: "", 17 inputIcon: "", 18 selected: "", 19 }, 20 icons: { 21 // () => ReactElement | JSX.Element 22 prev: () => <span>Previous</span>, 23 next: () => <span>Next</span>, 24 }, 25 datepickerClassNames: "top-12", 26 defaultDate: new Date("2022-01-01"), 27 language: "en", 28 disabledDates: [], 29 weekDays: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], 30 inputNameProp: "date", 31 inputIdProp: "date", 32 inputPlaceholderProp: "Select Date", 33 inputDateFormatProp: { 34 day: "numeric", 35 month: "long", 36 year: "numeric" 37 } 38} 39 40const DemoComponent = () => { 41 const [show, setShow] = useState < boolean > false 42 const [selectedDate, setSelectedDate] = (useState < Date) | (null > null) 43 const handleChange = (selectedDate: Date) => { 44 setSelectedDate(selectedDate) 45 console.log(selectedDate) 46 } 47 const handleClose = (state: boolean) => { 48 setShow(state) 49 } 50 51 return ( 52 <div> 53 <Datepicker options={options} onChange={handleChange} show={show} setShow={handleClose}> 54 <div className="..."> 55 <div className="..."> 56 <CalendarIcon /> 57 </div> 58 <input type="text" className="..." placeholder="Select Date" value={selectedDate} onFocus={() => setShow(true)} readOnly /> 59 </div> 60 </Datepicker> 61 </div> 62 ) 63}
disabled
true
true
Today
true
Clear
disabled
disabled
As seen on demo page
As seen on demo page
""
new Date()
en
[]
["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"] - Start at Monday even with another language
date
Same as "inputNameProp"
Select Date
{day: "numeric", month: "long", year: "numeric"}
This project is open-source under the MIT License.
After clone, you can run (separated):
No vulnerabilities found.
No security vulnerabilities found.