I achieve to change the background color of the navbar using css style but not the color of the text... I reproduce a basic example below to my code.
ui <- function(){
bootstrapPage('',
navbarPage(title = 'Hello'),
tags$style(type = 'text/css', '.navbar { background-color: #262626;
font-family: Arial;
font-size: 13px;
color: #FF0000; }',
'.navbar-dropdown { background-color: #262626;
font-family: Arial;
font-size: 13px;
color: #FF0000; }'))
}
server <- function(input, output, session){
}
shinyApp(ui = ui, server = server)
To theme a Shiny app, also check out the bslib package. From the docs: " The bslib R package provides tools for customizing Bootstrap themes directly from R, making it much easier to customize the appearance of Shiny apps & R Markdown documents." Thank you so much @williaml !
The value will correspond to the value argument that is passed to tabPanel. Determines whether the navbar should be displayed at the top of the page with normal scrolling behavior ( "static-top" ), pinned at the top ( "fixed-top" ), or pinned at the bottom ( "fixed-bottom" ).
The navbarMenu function also accepts strings, which will be used as menu section headers. If the string is a set of dashes like "----" a horizontal separator will be displayed in the menu.
@elphlord You change the text color and background color simultaneously by slightly changing your code to this: ui <- navbarPage (title = span ( "My Title", style = "background-color: #DEEBF7; color: red") However, I'm not sure on how to make the background color bigger!
Well, You just need to change the color on this css.
'.navbar-default .navbar-brand {
color: #cc3f3f;}'
Here, I changed to #cc3f3f to obtain a red text.
ui <- function(){
bootstrapPage('',
navbarPage(title = 'Hello'),
tags$style(type = 'text/css', '.navbar { background-color: #262626;
font-family: Arial;
font-size: 13px;
color: #FF0000; }',
'.navbar-dropdown { background-color: #262626;
font-family: Arial;
font-size: 13px;
color: #FF0000; }',
'.navbar-default .navbar-brand {
color: #cc3f3f;
}'
))
}
server <- function(input, output, session){
}
shinyApp(ui = ui, server = server)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With