New releases

Hotwire Club tooling is now open-source

Explore the agentic skills pack and the MCP server for building assistant workflows.

Faceted Search with Stimulus and Turbo Frames

Harness the power of Stimulus and Turbo Frames to drive a simple but powerful faceted search solution

View Solution on Patreon
Faceted Search with Stimulus and Turbo Frames

Premise

In this challenge we continue where we left off at Challenge 15 - Typeahead Search. We will extend its solution to a more elaborate and generic way to filter our book list.

Starting Point

Let’s start with the server side this time. As in Challenge 15, our “database” containing book records is a static json file that we require in the server’s entrypoint.

There, whenever the /results endpoint is hit with a GET request, we parse the query string into search params.

Then, we consecutively filter the books and return them in the results Turbo frame.

In the markup, we attached the faceted-search Stimulus contoller with /results as the base URL:

https://stackblitz.com/edit/stimulus-frames-faceted-search?file=index.html%3AL43

Whenever an input is being made, the controller’s perform action is triggered:

https://stackblitz.com/edit/stimulus-frames-faceted-search?file=index.html%3AL53

Challenge

Implement this perform action to set the src attribute of the frameTarget to include all query parameters from the formTarget:

Here’s what that should look like:

User clicking through a faceted search form

Teaser

Try a little code golf on this. How succinct can you be?

This is The Hotwire Club

49 hands-on challenges with detailed solutions, published biweekly since 2023. Subscribe to access all solutions and join the Discord community.

Subscribe on Patreon

More from

Turbo Frames - Error Boundaries
28 April 2026

Build a reusable Stimulus controller that catches Turbo Frame failures and shows elegant error states with retry - inspired by React's Error Boundaries.

Turbo Streams - Custom Stream Actions - pushState
14 April 2026

Synchronize browser history with Turbo Stream responses using a custom push_state action, a Stimulus controller, and the popstate event.

Turbo Frames - Chained Selects
24 March 2026

Build dependent dropdown menus that update dynamically using Turbo Frames and a small Stimulus controller.

Cookies
essential