New releases

Hotwire Club tooling is now open-source

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

Stimulus - Action Parameters

Use declaratively specified action parameters in the DOM to move elements between parents.

View Solution on Patreon
Stimulus - Action Parameters

Premise

Passing contextual information to Stimulus actions needed a bit of manual wiring of DOM data attributes. With action parameters, there’s an officially sanctioned way which we are going to explore now.

Starting Point

As a trivial example, we are looking at a simple ticket system where we want to triage incoming tickets. The user should be able to assign an issue to the Infrastructure, Devops, Mobile, and QA teams.

Challenge

Create a Stimulus controller that allows to move cards from the “Inbox” column to other ones using action parameters. Here’s a sneak peek:

A Kanban Board with 5 columns

The Stackblitz example contains four cards that are already wired up to the ticket Stimulus controller:

https://stackblitz.com/edit/stimulus-action-parameters?file=index.html%3AL58,controllers%2Fticket_controller.js

All that’s left to do for you is implement the action in the controller, and add the corresponding data attributes to the menu items:

https://stackblitz.com/edit/stimulus-action-parameters?file=index.html,controllers%2Fticket_controller.js%3AL4

Teaser

Currently, this example does not persist any changes to the database. How would you tackle this?

This is The Hotwire Club

46 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 - Chained Selects
24 March 2026

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

Stimulus - Web Share API
25 November 2025

Use the native browser web sharing capabilities from Stimulus

Faceted Search with Stimulus and Turbo Frames
10 December 2024

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

Cookies
essential