Closed sasshiburi closed 5 years ago
You can generate your label in the server and dynamically update it:
library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
shinyApp(
ui = dashboardPagePlus(
header = dashboardHeaderPlus(
enable_rightsidebar = TRUE,
rightSidebarIcon = "gears"
),
sidebar = dashboardSidebar(),
body = dashboardBody(
actionButton("new_job", "New Job"),
uiOutput("label")
),
rightsidebar = rightSidebar(),
title = "DashboardPage"
),
server = function(input, output) {
output$label <- renderUI({
dashboardLabel(
if (input$new_job) "some new text" else "some text",
status = "info"
)
})
}
)
I have a shiny app where I have am using a dashboardLabel as kind a sort of placeholder UI element to show some text. The issue is that I cannot seem to be able to update the label because it doesn't appear as there is a way for me to actually reference it.
I have tried something like the following:
However, my solution doesn't actually update the label text.