【发布时间】:2021-01-29 01:23:40
【问题描述】:
我在 Shiny 应用程序中使用 shinydashboard::sidebarSearchForm,并希望在其下方放置其他小部件。但是,每当我这样做时,它们都会被推出sidebarPanel 并进入侧边栏下方的空白处。在下面的代码中,materialSwitch 在sidebarPanel 中,但呈现在侧边栏的外部。但是,如果您将materialSwitch 放在sidebarPanel 中的sidebarSearchForm 上方,则所有小部件都正确包含在侧边栏中。如何确保所有这些小部件都留在侧边栏中?我希望materialSwitch 位于侧边栏的底部。谢谢!
library(shiny)
library(shinydashboard)
library(shinyWidgets)
ui <- tagList(
navbarPage(
theme = "simplex",
"App",
tabPanel("Do something",
sidebarPanel(
sliderInput("slider", "Select Num:"
,min = 1
,max = 10
,sep = ""
,value = c(1, 10)),
pickerInput(
inputId = "picker",
label = "Select:",
selected = "a",
choices = letters,
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"
),
multiple = TRUE
),
h5(HTML("<b>Search</b>")),
sidebarSearchForm(textId = "searchText",
buttonId = "searchButton",
label = "Include These"
),
h5(HTML("<b>Additional Options:</b>")),
materialSwitch(inputId = "add",
label = "Add?:?",
value = FALSE,
status = "primary")
),
mainPanel(
tabsetPanel(
tabPanel("Tab",
"text"
)
)
)
)
)
)
server <- function(input, output){
}
【问题讨论】:
标签: r shiny shinydashboard shinyapps