Dynamic left menu listing items downward instead of to the right

Hello,

I am trying to create a dynamic left menu (header), but the items are listed downward instead of to the right. I guess it has to do with the tagList wrapper when defining the UI.

Any ideas or suggestions?

Thanks!

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)
library(shinyWidgets)
library(stringr)


 ui = dashboardPage(
     dashboardHeader(
         leftUi =  tagList(uiOutput("filter"))
     ),
     dashboardSidebar(
         pickerInput(
                "inputParameters",
                "Parameters:",
                choices = c("a", "b", "c"),
                multiple = TRUE,
                options = list(
                    `actions-box` = TRUE,
                    size = 10,
                    `selected-text-format` = "count > 1"
                )
          )
     ),
     dashboardBody(),
     title = "DashboardPage"
)

server = function(input, output) {

    params <- reactive(input$inputParameters)
    
    output$filter = renderUI(
            lapply(seq_along(params()), function(i) {
                dropdownButton(
                    inputId = paste0("mydropdown", i),
                    label = params()[i],
                    icon = icon("sliders"),
                    status = "primary", 
                    circle = FALSE,
                    selectizeInput(
                        paste0("input", paste0(str_to_title(params()[i]))),
                        paste0(paste0(str_to_title(params()[i]), ":")),
                        choices = 1:3,
                        multiple = TRUE,
                        selected = 1:3
                    )
                )
            })
        )

}

shinyApp(ui, server)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.