get_width | R Documentation |
The value is reactive, therefore it must be accessed inside a reactive context
(such as an observe or reactive).
{shinybrowser} must be initialized with a call to detect()
in the app's ui.
get_width()
get_height()
User's detected browser width in pixels
User's detected browser height in pixels
The width and height of the browser window are only reported once, when the detect()
function is initially called.
If the user resizes the browser window, the new dimensions are not reported until
the page is refreshed.
detect()
, get_all_info()
if (interactive()) {
library(shiny)
ui <- fluidPage(
shinybrowser::detect(),
"Your browser dimensions:",
textOutput("browser_dim")
)
server <- function(input, output, session) {
output$browser_dim <- renderText({
paste0(shinybrowser::get_width(), "x", shinybrowser::get_height())
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.