如何将选项卡移动到R闪亮中侧边栏的底部?侧边、如何将、选项卡

2023-09-04 02:04:16 作者:再美的曾经、我只能回忆

我有一个用shinyDashboardPlus构建的闪亮仪表板。我有一个带有几个选项卡的侧边栏-像往常一样,它们在左上角对齐。

我的侧边栏滚动已通过style = "position: fixed;"修复。

adobe illustrator中如何安装字体

我想添加一个帮助/联系人选项卡,但我希望它位于侧边栏的左下角。我该怎么做?

推荐答案

您必须通过css设置相应li标记的样式。

请检查以下内容:

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Simple tabs"),
  dashboardSidebar(
    sidebarMenu(
      menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
      menuItem("Widgets", icon = icon("th"), tabName = "widgets",
               badgeLabel = "new", badgeColor = "green")
    )
  ),
  dashboardBody(
    tags$head(
      tags$style(HTML("
      #sidebarItemExpanded > ul > :last-child {
        position: absolute;
        bottom: 0;
        width: 100%;
        background-color: red;
      }

    "))),
    tabItems(
      tabItem(tabName = "dashboard",
              h2("Dashboard tab content")
      ),
      tabItem(tabName = "widgets", id = "widgetstabid",
              h2("Widgets tab content")
      )
    )
  )
)

server <- function(input, output, session) {
  
}

shinyApp(ui, server)

 
精彩推荐