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

2.0.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

Contents

Features

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

Documentation

Go to full documentation

⚠️ Supported versions

Only react-tailwindcss-datepicker versions greater than or equal to 1.7.4 receive bug fixes and new features. The table below lists compatibility with the different react versions:

Version React Version
2.x 19.x
1.x 17.x, 18.x

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

Install for react 18 project

yarn add react-tailwindcss-datepicker@1.7.3

Make sure you have installed the peer dependencies as well with the below versions.

"dayjs": "^1.11.12",
"react": "^17.0.2 || ^18.2.0" || "^19.0.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 { useState } from "react";
import Datepicker from "react-tailwindcss-datepicker";

const App = () => {
    const [value, setValue] = useState({
        startDate: null,
        endDate: null
    });

    return (
        <>
            <Datepicker value={value} onChange={newValue => setValue(newValue)} />
        </>
    );
};

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.

PlayGround

Clone the master branch and run commands:

# Using npm
npm install && npm dev

# Using yarn
yarn install && yarn dev

Open a browser and navigate to http://localhost:8888

Contributing

See CONTRIBUTING.md

Official Documentation repo

https://github.com/onesine/react-tailwindcss-datepicker-doc

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
2.0.05,738latest
1.0.9-11next

Version History

VersionDownloads (Last 7 Days)Published
2.0.05,738
1.7.38,510
1.7.26,083
1.7.12
1.7.027
1.6.616,195
1.6.558
1.6.43
1.6.3260
1.6.24
1.6.1283
1.6.0790
1.5.1174
1.5.019
1.4.2129
1.4.136
1.4.02
1.3.430
1.3.31
1.3.213
1.3.11
1.3.01
1.2.23
1.2.11
1.2.07
1.1.22
1.1.11
1.1.02
1.0.91
1.0.9-11
1.0.9-01
1.0.81
1.0.8-22
1.0.8-11
1.0.8-01
1.0.71
1.0.61
1.0.52
1.0.41
1.0.32
1.0.21
1.0.11

Package Sidebar

Install

npm i react-tailwindcss-datepicker

Weekly Downloads

41,757

Version

2.0.0

License

MIT

Unpacked Size

1.88 MB

Total Files

47

Last publish

Collaborators

  • onesine