
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
[!IMPORTANT] HotwireCombobox is at an early stage of development. It's nearing a beta release, but the API might change and bugs are expected. Please continue to use the library and report any issues in the GitHub repo.
First, make sure Turbo and Stimulus are configured and running properly on your app.
Then, add this line to your application's Gemfile and run bundle install:
gem "hotwire_combobox"
Finally, configure your assets:
Before continuing, you should know whether your app is using importmaps or JS bundling.
Most apps using importmaps won't need any configuration. If things aren't working for you, read on.
In app/javascript/controllers/index.js you should have one of the following:
Either,
import { application } from "controllers/application"
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)
Or,
import { application } from "controllers/application"
import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
lazyLoadControllersFrom("controllers", application)
Alternatively, modify app/javascript/controllers/application.js as follows:
import { Application } from "@hotwired/stimulus"
const application = Application.start()
// Add the following two lines:
import HwComboboxController from "controllers/hw_combobox_controller"
application.register("hw-combobox", HwComboboxController)
export { application }
First, install the JS portion of HotwireCombobox from npm with one of the following:
yarn add @josefarias/hotwire_combobox
npm install @josefarias/hotwire_combobox
Then, register the library's stimulus controller in app/javascript/controllers/application.js as follows:
import { Application } from "@hotwired/stimulus"
const application = Application.start()
// Add the following two lines:
import HwComboboxController from "@josefarias/hotwire_combobox"
application.register("hw-combobox", HwComboboxController)
export { application }
[!WARNING] Keep in mind you need to update both the npm package and the gem every time there's a new version of HotwireCombobox. You should always run the same version number on both sides.
This library comes with customizable default styles. Follow the instructions below to include them in your app.
Read the docs section for instructions on styling the combobox yourself.
This approach works for all setups. Simply add the stylesheet to your layout (this would go in your document's <head>):
<%= combobox_style_tag %>
This helper accepts any of the options you can pass to stylesheet_link_tag.
Require the styles in app/assets/stylesheets/application.css:
*= require hotwire_combobox
Visit the docs site for a demo and detailed documentation. If the site is down, you can run the docs locally by cloning the docs repo.
This gem follows the APG combobox pattern guidelines with some exceptions we feel increase the usefulness of the component without much detriment to the overall accessible experience.
These are the exceptions:
Up Arrow when the user is on the first option will select the last option. And pressing Down Arrow when on the last option will select the first option. In paginated comboboxes, the first and last options refer to the currently available options. More options may be loaded after navigating to the last currently available option.It should be noted none of the maintainers use assistive technologies in their daily lives. If you do, and you feel these exceptions are detrimental to your ability to use the component, or if you find an undocumented exception, please open a GitHub issue. We'll get it sorted.
Please read CONTRIBUTING.md.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that hotwire_combobox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.