tests/manual/callbacks-simple.R

library(dash)

dash_app() %>%
  set_layout(
    dccInput(id = "text", "sample"),
    div("CAPS: ", span(id = "out1")),
    div("small: ", span(id = "out2"))
  ) %>%
  add_callback(
    list(
      output("out1", "children"),
      output("out2", "children")
    ),
    input("text", "value"),
    function(text) {
      list(
        toupper(text),
        tolower(text)
      )
    }
  ) %>%
  run_app()

Try the dash package in your browser

Any scripts or data that you put into this service are public.

dash documentation built on June 23, 2022, 9:11 a.m.