Description Usage Arguments Details See Also
Turbo Streams deliver page changes as fragments of HTML wrapped in
self-executing <turbo-stream>
elements. Each stream element specifies an
action together with a target ID to declare what should happen to the HTML
inside it. These elements are delivered by the server over a WebSocket, SSE
or other transport to bring the application alive with updates made by other
users or processes.
1 2 3 4 5 6 7 | turbo_stream(
action = c("append", "prepend", "replace", "update", "remove", "before", "after"),
target,
...,
multiple = FALSE,
env = parent.frame()
)
|
action |
(str) the action to be taken for this stream element:
|
target |
(str) target of any links clicked in this:
|
... |
(tag) content of the element |
multiple |
(flg) if multiple targets, where |
env |
(env) calling environment |
It’s good practice to start your interaction design without Turbo Streams. Make the entire application work as it would if Turbo Streams were not available, then layer them on as a level-up. This means you won’t come to rely on the updates for flows that need to work in native applications or elsewhere without them.
Other Turbo:
turbo_assets()
,
turbo_frame()
,
turbo_link()
,
turbo_listener()
,
turbo_modifiers
,
turbo
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.