Download the PHP package coolsam/flatpickr without Composer
On this page you can find all versions of the php package coolsam/flatpickr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coolsam/flatpickr
More information about coolsam/flatpickr
Files in coolsam/flatpickr
Package flatpickr
Short Description Flatpickr input for Filamentphp
License MIT
Homepage https://github.com/coolsam/flatpickr
Informations about the package flatpickr
Use Flatpickr as your datepicker in the Filament Forms and Panels.
Supported Versions
Package Version | Supported Filament Version(s) |
---|---|
v2.x | Filament v2 |
v3.x | Filament v3 |
v4.x | Filament v3, Filament v4 |
Installation
Install the package via composer:
Run the installation command to publish the assets and config file:
This will publish the config file to config/flatpickr.php
and the assets to public/vendor/flatpickr
. The command will also ask you if you would like to overwrite the existing assets and config files if they exist.
If you choose to overwrite, the existing files will be replaced with the new ones. This is useful if you want to update the package to the latest version there have been changes to the config file or assets in the latest version.
If you are upgrading from a previous version be sure to run the following to ensure assets are up to date
Usage
You can do a lot with just one Component: Flatpickr
You can use the Flatpickr component from this package as:
- DatePicker
- TimePicker
- DateTimePicker
- Range Picker
- Week Picker,
- Multiple-Date Picker
- Month Picker
Most of the fluent config methods are similar to Flatpickr's official options in naming.
This package is also an extension of Filament's DateTimePicker, so most of the methods are similar to the ones in the DateTimePicker component. You can use the Flatpickr component as a drop-in replacement for the DateTimePicker component.
Here are some examples of the methods. Refer to Flatpickr's Official Documentation for details on each of the configurations.
Examples
Flatpickr Themes (See Flatpickr Docs for more Details)
Note: I highly recommend that you use the DEFAULT theme, which is styled using tailwind to conform to the filament design system. The other themes come with the flatpickr javascript package and may not conform to your Filament themeing, including dark mode.
You can set the package's theme globally under the theme
config in the config/flatpickr.php
file. The config accepts a \Coolsam\Flatpickr\Enums\FlatpickrTheme
enum value.
The \Coolsam\Flatpickr\Enums\FlatpickrTheme::DEFAULT
theme is already set by default and conforms to the filament design system.
See the screenshots below for the different themes.
State Types
The package supports the following state types:
string
orCarbonInterface
for DateTimePicker, DatePicker, TimePicker, WeekPicker, MonthPickerarray
for RangePicker, MultiplePicker (an array of date strings or CarbonInterface instances)
Screenshots
Single Date Picker
Multiple Date Picker
Date Range Picker
Date-Time Picker
Time-Only Picker
Show Multiple Months
Week Picker
Month Picker
Flatpickr Themes
DEFAULT
AIRBNB
LIGHT
DARK
CONFETTI
MATERIAL_BLUE
MATERIAL_GREEN
MATERIAL_ORANGE
MATERIAL_RED
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Savannabits
- All Contributors
License
The MIT License (MIT). Please see License File for more information.