Shiny module to save shiny widgets as html files. Internally, the conversion is done with htmlwidgets::saveWidget.

widgetDownload(input, output, session, rWidget, filename = "widget.html")

widgetDownloadUI(id, btnText = "Download widget")

Arguments

input, output, session

Standard shiny module parameters

rWidget

A reactive returning a shiny widget

filename

Argument to be passed to shiny::downloadHandler

id

The id of the module

btnText

The text appearing on the download button

Examples

if (FALSE) { shinyApp( fluidPage(widgetDownloadUI("wd")), function(input, output, session) { callModule(widgetDownload, "wd", reactive({ DT::datatable(mtcars) })) } ) }