Rails 7 and Stimulus: How to integrated TailwindCSS without any other JS library?

37 views Asked by At

For my new hobby project, I wanted to use Rails 7, Stimulus and the TailwindCSS framework. I was looking for some TailwindCSS templates and I found out that basically all of the templates require some other JS framework to work properly - typically React, Vue, or Alpine.

So basically, if I planned to use Rails 7 with Stimulus, I apparently also need to use, say, Alpine, because Tailwind does not come with templates on Stimulus. Similar situation is for Bootstrap.

Am I overlooking something, or is it common today that a Rails app is using its "native" JS framework (Stimulus) and another framework (React, Alpine) for the interaction with a CSS framework? Or - is there a better/cleaner way to handle this?

A few years back, the typical setup was Rails + JS/jQuery and integrating CSS templates was quite straightforward :)

0

There are 0 answers