stimulus_modifiers: Stimulus Modifiers

Description Usage Arguments Functions See Also

Description

These modify existing HTML tags so that Stimulus can act upon them.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
ss_control(
  controller,
  ...,
  values = list(),
  classes = list(),
  tag = tags$div,
  env = parent.frame()
)

ss_target(
  target,
  ...,
  tag = tags$div,
  controller = getOption("hotwire.R.controller")
)

ss_action(
  trigger = NULL,
  action,
  ...,
  option = c("capture", "once", "passive", "!passive"),
  tag = tags$div,
  controller = getOption("hotwire.R.controller"),
  descriptor = NULL
)

Arguments

controller

(str) name of the controller

...

(tag) content for the modified tags

values

(lst) named list of values for this controller

classes

(lst) named list of classes that will be applied/unapplied

tag

(fun) if it's a multiple tags, then the container tag

env

(env) calling environment

target

(str) name of the target

trigger

(str) the trigger action or event. This may be skipped using NULL for common elements: * a, button, input type=submit - click * form - submit * input, textarea - input * select - change Use <event>@<window/document> to listen for global events.

action

(str) the action to be run when the event fires

option

(str) DOM event listener option * capture - events of this type will be dispatchedbefore to any target beneath it * once - listener removed when invoked * passive - never call preventDefault * !passive - can call preventDefault

descriptor

(str) use this argument to override the descriptor and supply it directly.

Functions

See Also

Other Stimulus: ss_use_controller(), stimulus_assets(), stimulus


tjpalanca/hotwire.R documentation built on Dec. 23, 2021, 10:59 a.m.