【发布时间】:2021-09-23 10:51:59
【问题描述】:
我想创建一个Shiny 应用程序,其中包含多个collapsible 框作为一侧的菜单。为此,我到目前为止使用了bsCollapsePanel 函数并将其放入sidebarPanel。不幸的是,我从盒子到sidebarPanel 有一个额外的边距。盒子看起来已经启动了。但我只想使用可折叠的盒子作为侧边栏。
到目前为止,我使用了以下解决方案:
library(shinythemes)
library(shinyBS)
fluidPage(
theme = shinytheme("cosmo"),
titlePanel(# app title/description
"ShinyApp"),
sidebarLayout(
mainPanel(plotOutput("plot1")),
sidebarPanel(
bsCollapsePanel(
"Color Selection",
actionButton("f1blue", "Blue"),
actionButton("f1red", "Red"),
actionButton("f2blue", "Blue"),
actionButton("f2red", "Red"),
style = "success"
),
)
)
)
这就是它的外观。我想避免这种“盒中盒”效应。侧边栏面板只有可折叠,没有边框和边距:
是否有解决方案和/或另一个包更适合创建可折叠/手风琴?
感谢您的任何建议!
【问题讨论】:
-
您是否尝试过使用
flowLayout或verticalLayout? shiny.rstudio.com/images/shiny-cheatsheet.pdf
标签: r shiny accordion fluid-layout shinybs