if (interactive()) {
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
title = "Skeletons",
options = list(skeletonsOnLoad = TRUE),
f7SingleLayout(
navbar = f7Navbar(title = "f7Skeleton"),
f7Block(
f7Button("update", "Update card")
),
f7Card(
title = "Card header",
textOutput("test"),
),
f7List(
f7ListItem(
href = "https://www.google.com",
title = "Item 1"
),
f7ListItem(
href = "https://www.google.com",
title = "Item 2"
)
)
)
),
server = function(input, output, session) {
txt <- eventReactive(input$update,
{
Sys.sleep(3)
"This is a simple card with plain text,
but cards can also contain their own header,
footer, list view, image, or any other element."
},
ignoreNULL = FALSE
)
output$test <- renderText(txt())
observeEvent(input$update,
{
f7Skeleton(".card", "fade")
},
priority = 1000
)
}
)
}
Run the code above in your browser using DataLab