Hotwire Discussion

Search autocomplete with Stimulus and Rails

Hey All! I’ve created a simple search autocomplete example with Stimulus and Rails 5.2.

Please check it on GitHub and let me know if you have any questions:


Very nice work! I’ll soon be adding some autocomplete fields to a new Rails 5.2 + Stimulus project I’m working on, so I may very well crib from your example. :slight_smile:

1 Like

Hey All,

I just did a few updates to the example app. You can see them in the following commits:


I used datalist / option (can even have some kind of optgroup with option value / innerText. and it works quite well but probably not as well everywhere : )

Stimulus search now uses Stimulus 2.0:



Now bundled with jsbundling-rails and running on Stimulus 3.

1 Like