add_inputs | R Documentation |
For use in the shiny_emissions()
function. Adding an unknown quantity of textInputs.
add_inputs(numeric_input, label, value)
numeric_input |
Name of numerical input that controls the number of items to add. |
label |
Label of new textInput. |
value |
Value of new textInput. |
Returns textInput for use in the shiny_emissions()
function.
if(interactive()) {
ui <- shinydashboard::dashboardPage(header = shinydashboard::dashboardHeader(),
sidebar = shinydashboard::dashboardSidebar(),
shinydashboard::dashboardBody(
shiny::fluidRow(
shiny::column(12, align = "left",
shiny::splitLayout(shinydashboard::box(width = NULL,
shiny::numericInput("newbox_add",
"Number of new boxes:",
value = 0, min = 0),
shiny::uiOutput("newbox_input")))))))
server <- function(input, output) {
K_plane <- shiny::reactive({ input$newbox_add })
output$newbox_input <- shiny::renderUI({ add_inputs(numeric_input = K_plane(),
label = "New Box:",
value = "textbox") })
}
shiny::shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.