4

I'm having issues aligning two input widgets in Shiny.

  • Specifically, I can't seem to get a password input and an action button (generated using uiOutput()) to be bottom aligned in the same row.

My current approach offsets the two widgets:

enter image description here

when what I want is:

enter image description here

My code:

library(shiny)

ui <- fluidPage(
  fluidRow(
    column(width = 4,
           passwordInput(inputId = "answer.pass", label = "", value = "",
                         placeholder = "Enter Password for Answer")
    ),
    column(width = 2, offset = 0,
           uiOutput("actionBut.out")
    )
  )
)

server <- function(input, output) {
  output$actionBut.out <- renderUI({
    actionButton("copyButton1","Copy Code")
  })
}

shinyApp(ui = ui, server = server)

I've come across other SO posts and other sites that seem to have similar problems, but none of their solutions work for my example.

Can anyone suggest a working solution? Thanks!

Community
  • 1
  • 1
theforestecologist
  • 4,667
  • 5
  • 54
  • 91
  • 6
    its the empty label for passwordInput that is causing the problems `passwordInput(label = NULL, ...)` or adding `uiOutput(.., style = "padding:20px;")` will work albeit not relativly – Nate Apr 24 '17 at 15:19

0 Answers0