完全删除在Shiny Dashboard中隐藏和显示侧边栏的切换按钮。

huangapple go评论106阅读模式
英文:

Totally delete the toggle button that hides and display sidebar in shiny dashboard

问题

如何完全删除在shiny dashboard中隐藏和显示侧边栏的切换按钮?

## app.R ##
library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    collapsed = TRUE
  ),
  dashboardBody(
    
  )
)

server <- function(input, output) { }

shinyApp(ui, server)
英文:

How can I totally delete the toggle button that hides and display sidebar in shiny dashboard?

## app.R ##
library(shiny)
library(shinydashboard)

ui &lt;- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    collapsed = T
  ),
  dashboardBody(

    
  )
)

server &lt;- function(input, output) { }

shinyApp(ui, server)

答案1

得分: 1

library(shiny)
library(shinydashboard)

css <- ".sidebar-toggle {display: none;}"

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    collapsed = T
  ),
  dashboardBody(
    tags$head(tags$style(HTML(css)))
  )
)

server <- function(input, output) { }

shinyApp(ui, server)
英文:
library(shiny)
library(shinydashboard)

css &lt;- &quot;.sidebar-toggle {display: none;}&quot;

ui &lt;- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    collapsed = T
  ),
  dashboardBody(
    tags$head(tags$style(HTML(css)))
    
  )
)

server &lt;- function(input, output) { }

shinyApp(ui, server)

huangapple
  • 本文由 发表于 2023年5月25日 04:21:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76327151.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定