6

How can i change the title of this dashboard title header to be the following :

I want it to say Basic DASHBOARD where DASHBOARD is in BOLD, RED FONT and Basic is in the default white font - i also want to adjust the size of the font of DASHBOARD to be somewhat larger? any ideas of how to do this in shiny dashboard title?

so basically needs to be RED and BOLD for DASHBOARD and larger, BASIC stays the same,

code below

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 Answers1

18

You can use inline css to achieve that:

dashboardHeader(title = span("Basic ", 
                             span("dashboard", 
                             style = "color: red; font-size: 28px")))
thothal
  • 16,690
  • 3
  • 36
  • 71