Description Usage Arguments Details Value Examples
add a go top button on your shiny app. When the user clicks the button, scroll the window all the way to the top. Just add this function anywhere in you UI.
1 2 3 4 5 6 7 |
id |
element ID |
icon |
shiny::icon if you do not want to use the default rocket image |
right |
character string, css style, the button's position to window right |
bottom |
character string, css style, the button's position to window bottom |
color |
color of the icon. |
The button hides if you are on very top of the page. If you scroll down 50px, this button will appear.
a shiny component
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | if(interactive()){
library(shiny)
ui <- fluidPage(
h1("Scroll the page..."),
lapply(1: 100, function(x) br()),
spsGoTop("default"),
spsGoTop("mid", right = "50%", bottom= "50%", icon = icon("home"), color = "red"),
spsGoTop("up", right = "95%", bottom= "95%", icon = icon("arrow-up"), color = "green")
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.