Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to get rid of two two navBars with shiny apps in R?

I am trying to get rid of the two double bars within my R shiny app. I use shinydashord and shiny libraries. I inherited the codes, thus please bear with me.

I want to keep the red navigation bar but get rid of the green bar that is bellow it. How to do this?

This is the picture:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

And this is the partial code I use:

         app_ui <- function(request) {
  tagList(
    # Leave this function for adding external resources
    golem_add_external_resources(),
    
    shiny::fluidPage(
      theme = shinythemes::shinytheme("united"),
      
      tags$head(tags$style(".navbar {margin-bottom: 0px;}")),
      
      tags$head(
        tags$style(".container-fluid {padding-right: 0px; padding-left: 0px;}")
      ),
    
    # Your application UI logic
    # shinyUI(
      # navbarPage(
        navbarPage(
          title = div(
            img(src = "www/bftb_logo_v8_bare.png", height = "30px"),
            "AZ Oncology Bioinformatics Toolbox"
          ),
          windowTitle = "BFTB Landing Page",
        
        # windowTitle = "BFTB Landing Page",
        # title = div(img(src = "www/bftb_logo_v8_bare.png", height = "30px"), "AZ Oncology Bioinformatics Toolbox"),
        # theme = shinythemes::shinytheme("cerulean"),
        tabPanel("Toolbox", icon = icon("wrench"),
                 shinydashboard::dashboardPage(
                   header = NULL,
                  # header = shinydashboard::dashboardHeader(title = "   ", titleWidth = 300),
                   shinydashboard::dashboardSidebar(
                     width = 300 ,
                     shinydashboard::sidebarMenu(
                       shinydashboard::menuItem(
                         "Tools",
                         tabName = "tools_app",
                         icon = icon("wrench"),
                         shinydashboard::menuSubItem(
                           "Gene Expression/Signature/Pathways",
                           tabName = "gene_app",
                           icon = icon("chart-line")
                         ),
                         shinydashboard::menuSubItem(
                           "Genomic",
                           tabName = "genomic_app",
                           icon = icon("universal-access")
                         ),
                         shinydashboard::menuSubItem(
                           "Epigenetics",
                           tabName = "epi_app",
                           icon = icon("chart-bar")
                         ),
                         shinydashboard::menuSubItem(
                           "Immune-oncology",
                           tabName = "io_app",
                           icon = icon("heartbeat")
                         ),
                         shinydashboard::menuSubItem(
                           "Pharmacology",
                           tabName = "pharm_app",
                           icon = icon("plus-square")
                         ),
                         shinydashboard::menuSubItem(
                           "Cell line Selection",
                           tabName = "cell_app",
                           icon = icon("sellcast")
                         ),
                         shinydashboard::menuSubItem("Mouse",
                                                     tabName = "mouse_app",
                                                     icon = icon("paw")),
                         shinydashboard::menuSubItem(
                           "Haem Oncology",
                           tabName = "hemebase_app",
                           icon = icon("h-square")
                         ),
                         shinydashboard::menuSubItem("Multiomics",
                                                     tabName = "multiomics_app",
                                                     icon = icon("list")),
                         shinydashboard::menuSubItem(
                           "Other",
                           tabName = "other_app",
                           icon = icon("option-horizontal", lib = "glyphicon"))
                       )
                     )
                   ),
                   shinydashboard::dashboardBody(
                     shinydashboard::tabItems(
                       shinydashboard::tabItem("tools_app", mod_tools_path_ui("tools_path_ui_1")),
                       shinydashboard::tabItem("gene_app",mod_gene_expressions_sign_path_ui("gene_expression_sign_path_ui_1")),
                       shinydashboard::tabItem("genomic_app", mod_genomic_ui("genomic_ui_1")),
                       shinydashboard::tabItem("epi_app", mod_epi_ui("epi_ui_1")),
                       shinydashboard::tabItem("io_app", mod_io_ui("io_ui_1")),
                       shinydashboard::tabItem("pharm_app", mod_pharm_ui("pharm_ui_1")),
                       shinydashboard::tabItem("cell_app", mod_cell_ui("cell_ui_1")),
                       shinydashboard::tabItem("mouse_app", mod_mouse_ui("mouse_ui_1")),
                       shinydashboard::tabItem("hemebase_app", mod_hemebase_ui("hemebase_ui_1")),
                       shinydashboard::tabItem("multiomics_app", mod_multiomics_ui("multiomics_ui_1")),
                       shinydashboard::tabItem("other_app", mod_other_ui("other_ui_1"))))
                 )),
        shiny::tabPanel("Tutorials", icon = icon("graduation-cap"),mod_tutorials_ui("mod_tutorials_ui_1")),
        shiny::tabPanel("Workflows", icon = icon("list"), mod_workflows_ui("mod_workflows_ui_1")), 
        br(),
        br(),
        br()
      )
    ), # tags$footer("footer_app", mod_footer_ui("mod_footer_ui_1")
    tags$footer(mod_footer_ui("mod_footer_ui_1"))
  )
  # )

}

>Solution :

You had better sent a compeleted script then I could test it to make sure, however, you should set disable = TRUE in the shinydashboard::dashboardHeader function

header = shinydashboard::dashboardHeader(title = "   ", titleWidth = 300, disable = TRUE)

rather than

header = shinydashboard::dashboardHeader(title = "   ", titleWidth = 300)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading