I'd like to embed a local HTML document in a Shiny app (I used an URL here for the purpose of the example).
includeHTML()
works well but I'm getting a message suggesting to use tags$iframe()
instead. The problem is that iframe()
seems to use a fixed height for the embedded document, which isn't convenient. Is there any way to use the full height of the page with iframe()
? Using height = "100%"
doesn't work obviously and the function doesn't seem to have a minHeight
parameter.
library(shiny)
ui <- fluidPage(
htmlOutput("html")
)
server <- function(input, output, session) {
output$html <- renderUI({
# includeHTML("https://www.york.ac.uk/teaching/cws/wws/webpage1.html")
tags$iframe(
srcdoc = readr::read_file("https://www.york.ac.uk/teaching/cws/wws/webpage1.html"),
width = "100%",
frameBorder = "0",
)
})
}
shinyApp(ui, server)