One main panel and 2 side panels

10,520

You can use fluidRow and column. Here is an example. You can adjust the column width, as long as the total adds to 12.

library(shiny)

ui <- shinyUI(fluidPage(

   titlePanel("Old Faithful Geyser Data"),

   fluidRow(
     column(2,
            sliderInput("bins",
                        "Number of bins:",
                        min = 1,
                        max = 50,
                        value = 30),
            style="overflow-x: scroll; overflow-y: scroll"),
     column(8,
            plotOutput("distPlot")),
     column(2,
            textInput("test", "Test"),
            style="overflow-x: scroll; overflow-y: scroll")
   )
))

server <- shinyServer(function(input, output) {

   output$distPlot <- renderPlot({
      x    <- faithful[, 2] 
      bins <- seq(min(x), max(x), length.out = input$bins + 1)

      hist(x, breaks = bins, col = 'darkgray', border = 'white')
   })
})

shinyApp(ui = ui, server = server)
Share:
10,520

Related videos on Youtube

webbeing
Author by

webbeing

Updated on October 20, 2022

Comments

  • webbeing
    webbeing over 1 year

    Using Shiny, does anyone happen to know how to create a UI with one main panel (middle) and two side panels (left and right) with each one has their own horizontal and vertical scroll bar?

  • webbeing
    webbeing almost 8 years
    Hello, thank you for helping. I added 20 sliderinput and 20 text input to test the vertical scroll. It doesn't scroll. Do I need to do add anything to the code? Thanks.
  • Xiongbing Jin
    Xiongbing Jin almost 8 years
    You just need to add height: 400px; in style