# Generated by DropToApp library(shiny) library(bslib) ui <- page_sidebar( title = "Old Faithful Geyser Data", sidebar = sidebar( title = "Controls", sliderInput("bins", "Number of bins:", min = 1, max = 50, value = 30), selectInput( "var", "Variable", choices = c("waiting", "eruptions"), selected = "waiting" ) ), layout_columns( value_box( title = "Eruptions recorded", value = "272", theme = "primary" ), value_box( title = "Mean waiting time", value = "70.9 min", theme = "success" ) ), card( full_screen = TRUE, card_header("Histogram"), plotOutput("distPlot") ) ) server <- function(input, output, session) { # Inputs: input$bins, input$var output$distPlot <- renderPlot({ x <- faithful[[input$var]] bins <- seq(min(x), max(x), length.out = input$bins + 1) hist(x, breaks = bins, col = "#007bc2", border = "white", xlab = input$var, main = NULL) }) } shinyApp(ui, server)