From a51f0b45dc06fae3dcaaec1222f5563f95c6c466 Mon Sep 17 00:00:00 2001 From: Daniel Chen Date: Fri, 19 Jan 2024 12:16:01 -0800 Subject: [PATCH] update 01_hello app for bslib --- inst/examples/01_hello/app.R | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/inst/examples/01_hello/app.R b/inst/examples/01_hello/app.R index 887c50576d..5b3a72916c 100644 --- a/inst/examples/01_hello/app.R +++ b/inst/examples/01_hello/app.R @@ -1,34 +1,24 @@ +library(bslib) library(shiny) # Define UI for app that draws a histogram ---- -ui <- fluidPage( +ui <- page_sidebar( - # App title ---- - titlePanel("Hello Shiny!"), - - # Sidebar layout with input and output definitions ---- - sidebarLayout( + # Output: Histogram ---- + plotOutput(outputId = "distPlot"), - # Sidebar panel for inputs ---- - sidebarPanel( - - # Input: Slider for the number of bins ---- + # Sidebar panel for inputs ---- + sidebar = sidebar( + # Input: Slider for the number of bins ---- sliderInput(inputId = "bins", label = "Number of bins:", min = 1, max = 50, value = 30) + ), - ), - - # Main panel for displaying outputs ---- - mainPanel( - - # Output: Histogram ---- - plotOutput(outputId = "distPlot") - - ) - ) + # App title ---- + title = "Hello Shiny!" ) # Define server logic required to draw a histogram ----