如何更改闪亮的仪表板标题的颜色和字体?

时间:2018-11-15 11:55:44

标签: r shiny shinydashboard

如何将该仪表板标题的标题更改为以下内容:

我想说的是Basic DASHBOARD ,其中DASHBOARD为粗体,RED FONT和Basic为默认白色字体-我也想将DASHBOARD的字体大小调整为更大?关于如何在闪亮的仪表板标题中执行此操作的任何想法?

因此对于DASHBOARD或更高版本,基本上需要设为红色和粗体,BASIC保持不变,

下面的代码

library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
    # Boxes need to be put in a row (or column)
    fluidRow(
      box(plotOutput("plot1", height = 250)),

      box(
        title = "Controls",
        sliderInput("slider", "Number of observations:", 1, 100, 50)
      )
    )
  )
)

server <- function(input, output) {
  set.seed(122)
  histdata <- rnorm(500)

  output$plot1 <- renderPlot({
    data <- histdata[seq_len(input$slider)]
    hist(data)
  })
}

shinyApp(ui, server)

1 个答案:

答案 0 :(得分:1)

您可以使用内联css来实现:

dashboardHeader(title = span("Basic ", 
                             span("dashboard", 
                             style = "color: red; font-size: 28px")))