简体   繁体   中英

Hide title section of shiny dashboard in a way that the toggle button is in the most left spot of the dashboard header

I would like to know how can I totally skip the title section from shinydashboard header. So the first object to see will be the toggle button that hides and display the sidebar. Now if I set titlewidth to 0 there is still a small gap between the toggle button and the beginning of the page. Something like:

在此处输入图像描述

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(
  titleWidth = 0
  ),
  dashboardSidebar(
  ),
  dashboardBody(
    )
)

server <- function(input, output){}

shinyApp(ui, server)

Would adding this bit of CSS help?

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
 
  dashboardHeader(
    titleWidth = 0
  
  ),
  dashboardSidebar(
  ),
  dashboardBody(
    tags$style(type="text/css",".sidebar-toggle{ position: absolute;
    left: 0;
}")
  
  )
)

server <- function(input, output){}

shinyApp(ui, server)

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