turbo-patterns

Implement Hotwire Turbo patterns for Rails with frames, streams, and morphing.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/LaunchPadLab/ai-bank --skill turbo-patterns-launchpadlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turbo-patterns
Source: https://github.com/LaunchPadLab/ai-bank/tree/main/claude/skills/turbo-patterns
Command: npx skills add https://github.com/LaunchPadLab/ai-bank --skill turbo-patterns-launchpadlab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Turbo-driven Rails apps often suffer from brittle UI updates, inefficient context usage, and confusing real-time behavior when you don’t have proven patterns for Frames, Streams, and morphing.

Core Features & Use Cases

  • Turbo Streams actions & DOM updates: append, prepend, replace, update, remove, before, after, plus a morph-based custom strategy to preserve state and improve UX.
  • Turbo Frames for scoped navigation and lazy loading: inline editing, modals loaded on demand, and targeted frame updates that avoid full page reloads.
  • Real-time broadcasts with ActionCable/Turbo: update multiple subscribers via model/controller broadcasts and stream subscriptions.
  • Performance-minded UI behavior: conditional stream rendering, optimistic UI flows, and morphing to maintain focus/scroll during complex updates.

Quick Start

Ask an AI to generate a Rails 8 Hotwire implementation that updates a comments list using Turbo Frames for lazy loading, Turbo Streams for create/destroy responses, and Turbo morphing for preserving user focus on edits.

Frequently Asked Questions about turbo-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve user focus and scroll position during DOM updates in Rails Hotwire?

Turbo morphing preserves user focus and scroll position during complex Rails DOM updates by intelligently reconciling elements rather than fully replacing them. This custom strategy maintains UI state and improves UX during inline editing or live activity feeds.

What's the best way to handle inline editing and modals in Rails without full page reloads?

Turbo Frames provide scoped navigation and lazy loading for inline editing and modals without full page reloads. By targeting specific turbo_frame_tag elements, Rails delivers isolated UI updates that efficiently manage context and load content on demand.

How do I broadcast real-time updates to multiple subscribers using Turbo Streams and ActionCable?

Real-time broadcasts update multiple subscribers via model and controller broadcasts using ActionCable and Turbo Streams. Stream subscriptions automatically push DOM updates to connected clients by matching broadcast targets with specific DOM IDs and turbo stream actions.

Why do my Turbo Streams feel brittle when updating complex Rails UI workflows?

Turbo Streams become brittle without proven patterns for append, prepend, replace, and morph actions. Applying conditional stream rendering and optimistic UI flows ensures efficient context usage and prevents confusing real-time behavior during dynamic DOM updates.

Can I use Turbo Frames for lazy loading content in a Rails 8 application?

Yes, Turbo Frames support lazy loading content in Rails 8 applications by fetching targeted frame content on demand. Setting turbo_frame_tag targets allows scoped navigation and targeted frame updates that avoid full page reloads.

When should I not use Turbo morphing for Rails DOM updates?

Avoid Turbo morphing when simple Turbo Stream actions like replace or remove fully satisfy your Rails DOM update requirements. Morphing is specifically for complex UI workflows where preserving state, focus, and scroll position during dynamic updates is critical.