Download the PHP package dlogon/tailwind-alerts without Composer
On this page you can find all versions of the php package dlogon/tailwind-alerts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dlogon/tailwind-alerts
More information about dlogon/tailwind-alerts
Files in dlogon/tailwind-alerts
Package tailwind-alerts
Short Description create tailwind alerts from static
License MIT
Homepage https://github.com/Dlogon/tailwind-alerts
Informations about the package tailwind-alerts
Tailwind-alerts
Add tailwind alerts to your page with a single facade call
Installation
You can install the package via composer:
You need tailwind V2 or V3 and you need to check if your project has the default_alert_colors in your tailwind config file, if not, you can export the config file to change the default colors, or simply you can pass the background color you want in the level parameter, or you can add the config file inside the content node on module exports in your tailwind config file
You can publish the config file with:
This is the contents of the published config file:
Usage
add this Blade template
inside your viewport html wrapper
or you can choose the component style
Then, you can use the facade in any part of your code to add a toast message
Result
the default position and type of the alert is bottom toast, you can use 4 types of alerts, calling the addSessionMessage whit the correct parameters, or calling the helper functions
Then, you can use the facade in any part of your code to add a toast message
Result
If your response is not a redirect response, then you should set the static variable to false using the method if you use the helper functions, or you can set the last parameter in to
Where you use the component, you are able to use a javascript function to show alerts
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Diego
- All Contributors
License
The MIT License (MIT). Please see License File for more information.