I'd like to have KPI inside R Shiny tabpanel titles, like below, is there an elegant way to do this or a package which can do it? (Please note, the chart is irrelevant to the question).
This is my attempt:
Here is the code:
library(shinydashboard)
ui <- fluidPage({
ib1 <- infoBox("Test 1", 10 * 2, icon = icon("credit-card"), fill = TRUE)
ib2 <- infoBox("Test 2", 10 * 2, icon = icon("table"), fill = TRUE)
tabsetPanel(
tabPanel(ib1, plotOutput("plot")),
tabPanel(ib2)
)
})
server <- function(input, output, session) {
output$plot <- renderPlot({
hist(
rnorm(100),
main = paste("n =", 100),
xlab = ""
)
})
}
shinyApp(ui, server)