05:00
Building Interactive Web Apps with Shiny
Marquette University
SCoRT - Summer 2025
What is Shiny?
R package for interactive web apps
No web dev expertise needed
When to use: dashboards, interactive reports, teaching tools
Tutorial sources:
π Launch R: run shiny::runExample("01_hello").

ui defines layout and inputs/outputs
server contains R code & reactivity
# app.R single-file app
library(shiny)
ui <- fluidPage(
titlePanel("Hello Shiny"),
sidebarLayout(
sidebarPanel(sliderInput("obs", "Observations:", 1, 100, 50)),
mainPanel(plotOutput("distPlot"))
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
hist(rnorm(input$obs))
})
}
shinyApp(ui, server)ui defines layout and inputs/outputs
server contains R code & reactivity
Shiny apps come in two parts:
Defines the layout and appearance.
Contains elements such as:
Performs calculations.
Contains the logic to respond to user inputs, and update outputs.
Communicates with the UI to dynamically render outputs.
π Launch R: File > New File > Shiny Web Appβ¦
05:00
Open up your IDE of choice.
Make sure you have the {shiny} package installed.
Create an app.R file.
Add ui and server elements, as well as shiny::shinyApp(ui, server).
Check it works.
Inputs: textInput(), selectInput(), sliderInput(), etc.
Outputs: renderPlot(), renderTable(), renderUI(), etc.
Binding: output objects referenced by output$...
Reactive expressions: cache results
isolate(): break reactive chain
Observers: side-effect actions
What do we mean by deployment?



See posit-dev.github.io/r-shinylive.
The {shinylive} package converts a standard shiny app into a shinylive app:
Assuming your app.R file is in a folder called app:
You can then use the files in the site folder to deploy it as a normal website.
*not all R packages are available for shinylive.
**initial load time is still quite slow.
Build tests using shinytest2.
Building apps as packages helps with dependency management.
Learn a little bit of HTML, CSS, and Javascript.
Modules are a good way to reuse bits of UI and server code across the application.
Start with pen and paper⦠(think about user experience!)
RStudio tutorial: shiny.rstudio.com/tutorial
Mastering Shiny: mastering-shiny.org
ShinyUiEditor: rstudio.github.io/shinyuieditor
Shiny for Python: shiny.posit.co/py
shinythemes: rstudio.github.io/shinythemes
shinylive examples: shinylive.io/r/examples/
Examples: github.com/rstudio/shiny-examples/

Thank You