A Flatpickr Wrapper for Stimulus


#1

Hey

As an experiment, I have built a standard wrapper of the Flatpickr library.

One of my first goals was to publish a package on NPM (first time… so far from perfect) and also to package in a Stimulus way a standard library.

Overall this wrapper doesn’t bring a lot of magic but makes all Flatpickr options available as HTML tags and hooks available in the Controller. Therefore you can directly enable and configure a DateTime picker in your erb/html view with the data-attributes and extend a standard stimulus-flatpickr controller to add some business logic.

This was inspired by several initiatives:

Comments, issues, PR Welcome of course
:pray:


Conventions for shareable packages
#2

I’m using this library right now and love it! Was just about to implement something on my own but came across this. Thanks!


#3

Great glad to here your feedback @kylekeesling.
This means that this package has at least 2 users :slight_smile:.

Don’t hesitate to create an issue if find out something.