Animation On Action Button
hi all , i have a question . is that possible to add animation trigger on action button ? example like trigger when user touch the button and all that. any ideas ?
9 Replies
When a button is clicked a loading icon is shown... What else are you looking for?
probably like transition when user touch the action button
https://tailwindcss.com/docs/transition-property
So just add extra classes:
https://filamentphp.com/docs/3.x/widgets/stats-overview#adding-extra-html-attributes-to-a-stat
Transition Property - Tailwind CSS
Utilities for controlling which CSS properties transition.
Action::make('InviteUser')
->color('info')
->icon('heroicon-m-plus-circle')
->visible(auth()->user()->can('send invitation') || auth()->user()->hasRoleId(1))
->label('Kakitangan')
->extraAttributes([
'class' => 'transition-all'
])
i try implement like this but seems not working
Have you add transition-all to the whitelist classes or in a blade somewhere
No
But i already create one in my public js folder
Animation.js
then did you build?
The issue you have is, tailwind won't add the transition classes if it doesn't exist in a blade it is scanning or is whitelisted.
I just create js animation in the file animation.js
Can you show me how to let the extraattributes knows to use from my js file?
If the animation.js is loaded then they can be used. But I am unsure what you mean without seeing the animation.js