📅 Flatpickr Demo

Flatpickr guide

How to install flatpickr, wire up your first picker, and configure the options most forms actually need.

1. Install

CDN (fastest):

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>

npm:

npm install flatpickr
import flatpickr from "flatpickr";
import "flatpickr/dist/flatpickr.min.css";

2. Basic usage

<input class="date" placeholder="Select date...">
<script> flatpickr(".date", {}); </script>

flatpickr accepts a CSS selector, a DOM element, or a list of elements. Every example on this site is a live instance — start from the one closest to your use case:

3. Common options

OptionWhat it doesExample
modeSelection mode: single, multiple or range"range"
enableTimeShow time controlstrue
noCalendarHide the calendar (time-only picker)true
dateFormatFormat of the submitted value"Y-m-d H:i"
altInput / altFormatShow a human-friendly format to the user while submitting anotheraltFormat: "F j, Y"
minDate / maxDateLimit the selectable rangeminDate: "today"
disableDisable specific dates, ranges, or dates matching a functiondisable: ["2026-12-25"]
inlineRender the calendar in the page, always visibletrue
localeLanguage / regional formatting (51 locales ship with flatpickr)"de", "zh"
defaultDatePre-selected date when the picker opens"2026-11-16"

4. FAQ

Does flatpickr need jQuery or any other library?
No — it is dependency-free, which is its main selling point over older pickers.

How big is it?
The v4.6.13 minified build served on this site is about 50 KB of JS and 16 KB of CSS (uncompressed).

Can I change the colours?
Yes — eight themes ship in dist/themes/ (airbnb, confetti, dark, light and four material colours), or override the CSS variables/classes yourself.

Which browsers are supported?
Per the upstream README: IE9+, Edge, iOS Safari 6+, Chrome 8+, Firefox 6+.

Is this the official site?
No. This is an independent demo mirror of the MIT-licensed library; the official documentation lives at flatpickr.js.org and the source at github.com/flatpickr/flatpickr.