Description Super classes Methods See Also
Stimulus is a JavaScript framework with modest ambitions. Unlike other front-end frameworks, Stimulus is designed to enhance static or server-rendered HTML—the “HTML you already have”—by connecting JavaScript objects to elements on the page using simple annotations.
webtools::Configurable -> webtools::Plugin -> Stimulus
new()Create a new TurboPlugin
Stimulus$new(controllers, app_version)
controllers(chr) paths to controller JS files
app_version(str) a string that indicates the version
router()Create a Stimulus enabled page
Stimulus$router( path, handler, ..., stimulus = TRUE, lang = NULL, fragment = FALSE )
path(str) endpoint
handler(fun) handler; must have arguments
request, response, keys, ... and
set the body to html tags
...(arg) passed to self$router_html()
stimulus(opt) include stimulus controller assets
FALSE - don't include stimulus controllers
TRUE - include default stimulus controllers
character() - vector of paths to stimulus controller JS files;
included along with defaults, include the word
"default" to include the default assets
lang(str) language, defaults to en.
fragment(flg) is this just a part of a document?
assets()Generates Stimulus Assets
Stimulus$assets(stimulus = TRUE)
stimulus(opt) include stimulus controller assets
FALSE - don't include stimulus controllers
TRUE - include default stimulus controllers
character() - vector of paths to stimulus controller JS files;
included along with defaults, include the word
"default" to include the default assets
clone()The objects of this class are cloneable with this method.
Stimulus$clone(deep = FALSE)
deepWhether to make a deep clone.
Other Stimulus:
ss_use_controller(),
stimulus_assets(),
stimulus_modifiers
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.