A nice photo browser.
Usage
f7PhotoBrowser(
photos,
theme = c("light", "dark"),
type = c("popup", "standalone", "page"),
...,
id = NULL,
session = shiny::getDefaultReactiveDomain()
)
Arguments
- photos
List of photos
- theme
Browser theme: choose either light or dark.
- type
Browser type: choose among
c("popup", "standalone", "page")
.- ...
Other options to pass to the photo browser. See https://framework7.io/docs/photo-browser#photo-browser-parameters for more details.
- id
Unique id. Useful to leverage updateF7Entity on the server.
- session
Shiny session object.
Examples
library(shiny)
library(shinyMobile)
app <- shinyApp(
ui = f7Page(
title = "f7PhotoBrowser",
f7SingleLayout(
navbar = f7Navbar(title = "f7PhotoBrowser"),
f7Block(
f7Button(inputId = "togglePhoto", "Open photo")
)
)
),
server = function(input, output, session) {
observeEvent(input$togglePhoto, {
f7PhotoBrowser(
id = "photobrowser1",
theme = "dark",
type = "page",
photos = list(
list(url = "https://cdn.framework7.io/placeholder/sports-1024x1024-1.jpg"),
list(url = "https://cdn.framework7.io/placeholder/sports-1024x1024-2.jpg"),
list(url = "https://cdn.framework7.io/placeholder/sports-1024x1024-3.jpg",
caption = "Me cycling")
),
thumbs = c(
"https://cdn.framework7.io/placeholder/sports-1024x1024-1.jpg",
"https://cdn.framework7.io/placeholder/sports-1024x1024-2.jpg",
"https://cdn.framework7.io/placeholder/sports-1024x1024-3.jpg"
)
)
})
}
)
if (interactive() || identical(Sys.getenv("TESTTHAT"), "true")) app