Align widget inside shinydashboard box?

Is there a way of aligning a widget inside a shinydashboard box? For example, in the following app:

library(shiny)
library(shinydashboard)
library(shinyWidgets)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(box(
    title = "Test", width = 4, solidHeader = TRUE, status = "primary",
    dropdownButton(
      inputId = "mydropdown",
      label = "Controls",
      icon = icon("sliders"),
      status = "primary",
      circle = FALSE,
      numericInput("obs", "Observations:", 10, min = 1, max = 100)
    ),
    plotOutput('plot')
  ))
)

server <- function(input, output) {
  output$plot <- renderPlot({
    hist(runif(input$obs))
  })
}

shinyApp(ui, server)

I would like to align the dropdownButton widget to the bottom right corner of the Test box. How can I do that?

geovany answered my question at StackOverflow, in case this is helpful to someone else:

library(shiny)
library(shinydashboard)
library(shinyWidgets)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(box(
    title = "Test", width = 4, solidHeader = TRUE, status = "primary",
    plotOutput('plot'),
    div(class = "pull-right",
      dropdownButton(
        inputId = "mydropdown",
        label = "Controls",
        icon = icon("sliders"),
        status = "primary",
        circle = FALSE,
        numericInput("obs", "Observations:", 10, min = 1, max = 100)
      )
    )
  ))
)

server <- function(input, output) {
  output$plot <- renderPlot({
    hist(runif(input$obs))
  })
}

shinyApp(ui, server)

This topic was automatically closed 7 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.