-
-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatible with HTMX? #697
Comments
Hello. Create a script
In your tailwind input file add this:
In you html
This will work on element such as this one:
It obviously works on button too (it works on all elements). This solution in inspired from this: https://css-tricks.com/how-to-recreate-the-ripple-effect-of-material-design-buttons/ |
I'm trying to evaluate whether this library will work with HTMX.
So i.e. with one of the non-SPA framework integration options, such as https://www.material-tailwind.com/docs/html/guide/django
The docs show that in this case you should add the script tag at the bottom of the page.
Looking at the contents of the script (e.g. for Ripple effect) it seems that this is a run-once initialisation, via a self-invoking anonymous function.
I haven't tried it, but seems like this is not going to work with HTMX since any components loaded by subsequent request won't be initialised, and there's no way to get a reference to the initialiser to call it manually.
OTOH the React integration docs recommend exactly the same thing: https://www.material-tailwind.com/docs/html/guide/react-vite#ripple-effect so perhaps I am missing something about how this works?
Or maybe those docs are obsolete? I see elsewhere there are different docs https://www.material-tailwind.com/docs/react/guide/vite which show installing dedicated React components
npm i @material-tailwind/react
and not adding the script tag, seems like that way is more likely to work for an SPA.My questions are:
The text was updated successfully, but these errors were encountered: