
flatpickr
A lightweight, dependency-free date and time picker for web pages.
- Stars
- 16.5k
- Forks
- 1.5k
- Licence
- MIT
- Language
- TypeScript
- Last update
- 2.3 years ago
- Type
- Library
No commits in over a year — check for forks or alternatives before adopting.
What it is
flatpickr is a JavaScript library that adds a date and time picker to a web page, so visitors can choose dates from a calendar popup instead of typing them. It is described as having no dependencies, so it does not require jQuery, Bootstrap, or moment.js. The README says it supports date and time input, range and multiple-date selection, and 51 locales.
- Add a date-range picker to a booking form
- Let users pick a time only, using the time-picker mode
- Disable specific dates or dates chosen by custom logic, such as weekends or fully booked days
- Show dates in a human-friendly format in a web form
Great for
- Web developers who need a date or time input in a JavaScript app
- Teams that want to avoid adding large dependencies like jQuery or Bootstrap
- Projects that need date range selection
- Sites that must support many languages through its locale options
Not ideal for
- Projects that only need a plain browser date field, since native inputs need no library
- Teams needing a framework-specific component without a wrapper, since the README points to separate community wrappers for React, Vue, and others
- Older browsers outside the listed compatibility range, since the README lists IE9 and up as the baseline
How to get it
- 1
Install with a package manager
Clone the repository
git clone https://github.com/flatpickr/flatpickr - 2
Run it
- Read the demos and documentation at https://flatpickr.js.org
- Include the flatpickr library in your web page, following the documentation
- Attach flatpickr to an existing date or time input field
- Open the page in a browser and click the input to see the calendar popup
- 3
Get the most out of it
- Use the range and multiple-date options for booking or filtering forms
- Set one of the built-in locales for multilingual sites
- Apply a built-in theme, including dark or material, to match your design
- Use the disable option with custom logic to block specific dates
Downloads
Strengths
- The README states it has no dependencies and a small footprint compared with other libraries
- Includes many built-in features such as ranges, multiple dates, week numbers, and 8 themes
- Documentation and demos are available at the project homepage
Trade-offs
- The README is truncated and gives limited detail on setup and API, so some specifics are unclear from this text alone
- Wrapper components for frameworks are maintained separately by other authors, so quality and update pace may vary
- Last push date is 2024-08-02, so recent maintenance activity should be checked before adopting it
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| flatpickr (this) | 16.5k | Library | beginner | 2.3 years ago | Web developers who need a date or time input in a JavaScript app |
| dayjs | 48.7k | Library | beginner | 2 months ago | JavaScript developers who used Moment.js and want a smaller library |
| react-dates | 12.2k | Library | intermediate | 2.6 years ago | React developers who need a date or date-range picker in a web app |
| luxon | 16.5k | Library | beginner | 3 months ago | JavaScript developers who need to work with dates and time zones in an app |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.