R's interface for dragula library for moving around elements in shiny app.
source("https://install-github.me/zzawadz/dragulaR")
Every app in inst/apps/ is also published as a static
Shinylive build - it runs entirely in
the browser via WebAssembly, with no Shiny server involved. Try them without
installing anything at https://zzawadz.github.io/dragulaR/.
To build the site yourself:
# shinylive resolves the wasm binary from where dragulaR was installed,
# so install it from r-universe to get the development build
install.packages("dragulaR", repos = "https://zzawadz.r-universe.dev")
install.packages(c("shinylive", "shinydashboard"))
Rscript tools/build-shinylive.R _shinylive
Rscript -e 'httpuv::runStaticServer("_shinylive")'
The output in _shinylive/ is static files only, so it can be served from
GitHub Pages or any static host.
library(dragulaR)
runApp(system.file("apps/example01-dragula", package = "dragulaR"))

runApp(system.file("apps/example02-input", package = "dragulaR"))

renderUI
runApp(system.file("apps/example06-dragula-dynamic-elements-renderUI", package = "dragulaR"))

runApp(
system.file("apps/example06-dragula-dynamic-elements-renderUI", package = "dragulaR"),
display.mode = "showcase")
dragula
See dragula README for valid options.
runApp(
system.file("apps/example07-input-options", package = "dragulaR"),
display.mode = "showcase")
Use the maxItems option to restrict the number of items that can be dropped into a container:
# Limit "Model" container to 3 items maximum
dragula(c("Available", "Model"), maxItems = list(Model = 3))
# Run the example app
runApp(system.file("apps/example08-max-items", package = "dragulaR"))
library(dragulaR)
dir(system.file("apps/", package = "dragulaR"))
# dashboard-example
# example01-dragula
# example02-input
# example03-dragula-get-elements-order
# example04-dragula-module
# example05-dragula-dynamic-elements
# example06-dragula-dynamic-elements-renderUI
# example07-input-options
# example08-max-items