Reactive Phlex components for Rails
Livewire-style actions and live cross-tab updates — without writing Stimulus controllers or hand-picking Turbo Stream targets. Every demo below runs live.
Signed identity, not state
The DOM carries a MessageVerifier-signed { c, gid } — never raw state. Tampering fails verification.
Default-deny actions
Only methods you declare with action :name run. Undeclared → 403. You authorize inside the action.
One re-render unit
A click, a form change, and a background broadcast all resolve to “render this component into that id.”
pgbus-optional transport
Broadcasts route through Turbo Streams — Action Cable OR pgbus over Postgres SSE. No hard dependency.
Live demos
Searchable combobox
→Debounced live filtering over an in-memory list — zero custom JavaScript.
Counter
→State-backed actions with and without params — the simplest reactive shape.
Payment split
→Live sum-to-total rebalancer: nested bracketed params, a disabled computed field, auto-collected siblings — the pattern behind #64–#67.
Todo list
→Record-backed rows (GlobalID identity): add, toggle, inline-rename, archive.
Chat room
→Action + live broadcast over Turbo Streams (same-process async cable in this demo).
Team inbox
→The flagship — reactive_collection rows + optimistic archive (revert on failure) + disable_with + cross-tab broadcast + an on_client kebab + error_flash.