Change The Title Header Color Permanently in Shiny Dashboard

Change the title header color permanently in shiny dashboard

You can create a custom theme to use with {shinydashboard} with the {fresh} package, more documentation here : https://dreamrs.github.io/fresh/articles/vars-shinydashboard.html

Here an example to modify header background color:

library(fresh)
# Create the theme
mytheme <- create_theme(
adminlte_color(
light_blue = "#E7FF6E"
)
)

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
header = dashboardHeader(title = "My dashboard"),
sidebar = dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Settings", tabName = "settings", icon = icon("sliders"))
)
),
body = dashboardBody(

use_theme(mytheme) # <-- use the theme
)
)

server <- function(input, output, session) {

}

shinyApp(ui, server)

How to change colour and font of shiny dashboard title?

You can use inline css to achieve that:

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

Set title/header in Shiny Dashboard

You can set the title via:

ui <- dashboardPage(title="Browser tab title", 
dashboardHeader(title = "Dashboard title"),
dashboardSidebar()
)

R Shiny: How do you change the background color of the Header?

Try something like

tags$style(".span12 {background-color: black;}")

instead of

tags$style("body {background-color: black;}")

Set image, title and buttons in the same line of the header of a shiny dashboard

Perhaps you are looking for this.

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(shinyjs)
mytitle <- paste0("Life, Death & Statins")
dbHeader <- dashboardHeaderPlus(
titleWidth = "0px",
tags$li(a(href = "http://https://www.uow.edu.au/", # '',
div(style = "margin-left:-15px;margin-bottom:-83px;margin-top:-15px;padding: 0px 1190px 0px 0px ; width: 290px;",
img(src = 'YBS.png', height = "125px",width="232px")),
div(style="display: inline;margin-top:-35px; padding: 0px 90px 0px 800px ;font-size: 58px ;color: black;font-family:Times-New Roman;font-weight: bold; width: 500px;",HTML(mytitle)),
div(style="display: inline;margin-top:25px; padding: 0px 0px 0px 800px;vertical-align:top; width: 150px;", actionButton("well", "Welcome")),
div(style="display: inline;margin-top:15px; padding: 0px 0px 0px 0px;vertical-align:top; width: 150px;", actionButton("info", "Information")),
div(style="display: inline;padding: 0px 0px 0px 0px;vertical-align:top; width: 150px;", actionButton("conse", "Consent")),
div(style="display: inline;padding: 0px 0px 0px 0px;vertical-align:top; width: 150px;", actionButton("pswd", "Password")),
div(style="display: inline;padding: 0px 0px 0px 0px;vertical-align:top; width: 150px;", actionButton("rp", "Run Project")),
div(style="display: inline;padding: 0px 0px 0px 0px;vertical-align:top; width: 150px;", actionButton("res", "Results"))

),
class = "dropdown")


)

shinyApp(
ui = dashboardPagePlus(
header = dbHeader,
sidebar = dashboardSidebar(width = "0px"
),
body = dashboardBody(

useShinyjs(),
tags$script(HTML("$('body').addClass('fixed');")),

tags$head(tags$style(".skin-blue .main-header .logo { padding: 0px;}"))

)

),
server<-shinyServer(function(input, output,session) {
hide(selector = "body > div > header > nav > a")

}
)
)

output

R Shiny Dashboard, change color for all hyperlinks

Hyperlinks have tag <a>. You can globally change hyperlink color by applying css to that tag. Here's minimal example -

library(shiny)

shinyApp(
ui = fluidPage(
tags$head(tags$style(HTML("a {color: red}"))),
tags$a("click here"),
br(),
tags$a("click here as well")
),
server = function(input, output, session) {

}
)


Related Topics



Leave a reply



Submit