The parameter themein fluidPageinserts a CSS script with the following call:
tags$head(tags$link(rel = "stylesheet", type = "text/css",
href = input$Skin))
You can simply add this html as a reactive element to your ui:
library(shiny)
runApp(list(ui = fluidPage(
tabsetPanel(
tabPanel("Main"),
tabPanel("Settings",
textInput("Skin", "Select Skin", value = "bootstrap1.css")
), type = "pills", position = "above"
),
uiOutput("myUI")
)
, server = function(input, output, session){
output$myUI <- renderUI({
tags$head(tags$link(rel = "stylesheet", type = "text/css",
href = input$Skin))
})
}
))
source
share