WinBox | R Documentation |
A window manager with JavaScript library WinBox.js.
WinBox(
title,
ui,
options = wbOptions(),
controls = wbControls(),
id = NULL,
padding = "5px 10px",
auto_height = FALSE,
session = shiny::getDefaultReactiveDomain()
)
closeWinBox(id, session = shiny::getDefaultReactiveDomain())
title |
Title for the window. |
ui |
Content of the window. |
options |
List of options, see |
controls |
List of controls, see |
id |
An unique identifier for the window, if a window with the same |
padding |
Padding for the window content. |
auto_height |
Automatically set height of the window according to content. Note that if content does not have a fix height it may not work properly. |
session |
Shiny session. |
No value, a window is openned in the UI.
You need to include html_dependency_winbox()
in your UI definition for this function to work.
library(shiny)
library(shinywb)
ui <- fluidPage(
html_dependency_winbox(),
actionButton(inputId = "show", label = "Show WinBox"),
verbatimTextOutput("res")
)
server <- function(input, output, session) {
observeEvent(input$show, {
WinBox(
title = "WinBox window",
ui = tagList(
tags$h2("Hello from WinBox!"),
"Text content of winbox.",
selectInput("month", "Select a month:", month.name)
)
)
})
output$res <- renderPrint(input$month)
}
if (interactive())
shinyApp(ui, server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.