nloomis_react-tailwindcss-datepicker
TypeScript icon, indicating that this package has built-in type declarations

1.9.0 • Public • Published

React Tailwindcss Datepicker

React Tailwindcss Datepicker

A modern date range picker component for React using Tailwind 3 and dayjs. Alternative to Litepie Datepicker which uses Vuejs.

npm version npm downloads

Features

  • ✅ Theming options
  • ✅ Dark mode
  • ✅ Single Date
  • ✅ Single date use Range
  • ✅ Shortcuts
  • ✅ TypeScript support
  • ✅ Localization(i18n)
  • ✅ Date formatting
  • ⬜ Disable specific dates
  • ⬜ Custom shortcuts

Documentation

Go to full documentation

Installation

⚠️ React Tailwindcss Datepicker uses Tailwind CSS 3 (with the @tailwindcss/forms plugin) & Dayjs under the hood to work.

Install via npm

$ npm install react-tailwindcss-datepicker 

Install via yarn

$ 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

// 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:

import React, {useState} from "react";
import Datepicker from "react-tailwindcss-datepicker";

const App = () => {
    const [value, setValue] = useState({
        startDate: new Date(),
        endDate: new Date().setMonth(11)
    });
    
    const handleValueChange = (newValue) => {
        console.log("newValue:", newValue);
        setValue(newValue);
    }
    
    return (
        <div>
            <Datepicker
                value={value}
                onChange={handleValueChange}
            />
        </div>
    );
};

export default App;

Theming options

Light Mode

Light Mode

Dark Mode

Dark Mode

Supported themes Theme supported

Teal themes example Theme supported

You can find the demo at here

Info

👉 To discover the other possibilities offered by this library, you can consult the full documentation.

Contributing

Got ideas on how to make this better? Open an issue!

Thanks to

I thank you in advance for your contribution to this project.

License

MIT Licensed. Copyright (c) Lewhe Onesine 2022.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.9.07latest

Version History

VersionDownloads (Last 7 Days)Published
1.9.07
1.8.90
1.8.80
1.8.70
1.8.60
1.8.50
1.8.40
1.8.30
1.8.20
1.8.10
1.8.00
1.7.90
1.7.80
1.7.70
1.7.60
1.7.50
1.7.40
1.7.30
1.7.20
1.7.10
1.7.00
1.6.90
1.6.80
1.6.70
1.6.60
1.6.50
1.6.40
1.6.30
1.6.20
1.6.10
1.6.00
1.5.90
1.5.80
1.5.70
1.5.60
1.5.50
1.5.40
1.5.30
1.5.20
1.5.10
1.5.00
1.4.90
1.4.80
1.4.70
1.4.60
1.4.50
1.4.40
1.4.30
1.4.20
1.4.10
1.4.00
1.3.50
1.3.40
1.3.30
1.3.20
1.3.10
1.3.01
1.2.70
1.2.60
0.0.10
1.2.50
1.2.40
1.2.30
1.2.20

Package Sidebar

Install

npm i nloomis_react-tailwindcss-datepicker

Weekly Downloads

8

Version

1.9.0

License

MIT

Unpacked Size

469 kB

Total Files

23

Last publish

Collaborators

  • nloomis