简体   繁体   中英

How to customize navbar in Shiny R?

Is there a way to use a pre-made theme such as "cosmos" from the shinythemes package but to just change a few things with the navbar?

I would like to change the background color, text color, and the hover color of the navbar.

I have successfully changed the background color but am unable to find a way to change the text and color of the navbar when the mouse hovers over a tab.

This is what I have so far:

theme = shinytheme("cosmo"), #app theme
tags$head(tags$style(".navbar {background-color:darkgreen;}")) #navbar color

You can create your own .css file and put it in your www directory ( see here in the CSS section, or here section 1) - make sure the permissions are correct .

So if you just want to slightly alter the cosmo theme then you can download it and tweak as desired. Or create one from scratch, as in the first link, and take inspiration from cosmo (or use those commands and just add them to your UI - no need for CSS).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM