turbo_power
is a power-pack for Turbo Streams. It provides Turbo Streams with a bunch of new actions and additionally adds the morph
action from turbo-morph
and the invoke
action from turbo_ready
.
Note: Requires Turbo 7.2+
yarn add turbo_power
// application.js
import * as Turbo from '@hotwired/turbo'
+import TurboPower from 'turbo_power'
+TurboPower.initialize(Turbo.StreamActions)
Checkout the instructions in the turbo_power-rails
repo.
turbo_stream.graft(target, parent, **attributes)
turbo_stream.inner_html(target, html = nil, **attributes, &block)
turbo_stream.insert_adjacent_html(target, html = nil, position: 'beforeend', **attributes, &block)
turbo_stream.insert_adjacent_text(target, text, position: 'beforebegin', **attributes)
turbo_stream.morph(target, html = nil, **attribtues, &block)
turbo_stream.outer_html(target, html = nil, **attributes, &block)
turbo_stream.text_content(target, text, **attributes)
turbo_stream.set_meta(name, content)
turbo_stream.add_css_class(target, classes, **attributes)
turbo_stream.remove_attribute(target, attribute, **attributes)
turbo_stream.remove_css_class(target, classes, **attributes)
turbo_stream.set_attribute(target, attribute, value, **attributes)
turbo_stream.set_dataset_attribute(target, attribute, value, **attributes)
turbo_stream.set_property(target, property, value, **attributes)
turbo_stream.set_style(target, name, value, **attributes)
turbo_stream.set_styles(target, styles, **attributes)
turbo_stream.set_value(target, value, **attributes)
turbo_stream.dispatch_event(target, name, detail: {}, **attributes)
turbo_stream.clear_storage(type, **attributes)
turbo_stream.clear_local_storage(**attributes)
turbo_stream.clear_session_storage(**attributes)
turbo_stream.remove_storage_item(key, type, **attributes)
turbo_stream.remove_local_storage_item(key, **attributes)
turbo_stream.remove_session_storage_item(key, **attributes)
turbo_stream.set_storage_item(key, value, type, **attributes)
turbo_stream.set_local_storage_item(key, value, **attributes)
turbo_stream.set_session_storage_item(key, value, **attributes)
turbo_stream.redirect_to(url, action_name = nil, **attributes)
turbo_stream.reload(**attributes)
turbo_stream.scroll_into_view(target, inline = "nearest")
turbo_stream.set_cookie(cookie, **attributes)
turbo_stream.set_cookie_item(key, value, **attributes)
turbo_stream.set_focus(target, **attributes)
turbo_stream.set_title(title, **attributes)
turbo_stream.history_go(delta, **attributes)
turbo_stream.push_state(url, title = nil, state = nil, **attributes)
turbo_stream.replace_state(url, title = nil, state = nil, **attributes)
turbo_stream.console_log(message, level = :log, **attributes)
turbo_stream.console_table(data, columns, **attributes)
turbo_stream.notification(title, options, **attributes)
turbo_stream.reload_turbo_frame(frame_id, **attributes)
turbo_stream.set_turbo_frame_src(frame_id, src, **attributes)
TurboPower is heavily inspired by CableReady and it's operations. This library aims to bring the same level of operation-diversity to Turbo Streams.
turbo_power
is MIT-licensed open-source software from Marco Roth.
turbo_ready
is MIT-licensed open-source software from Nate Hopkins.
turbo-morph
is MIT-licensed open-source software from Marco Roth.
Turbo is MIT-licensed open-source software from Basecamp.