# NOT RUN {
if (interactive()) {
library(shiny)
library(shinyMobile)
cars <- rownames(mtcars)
shiny::shinyApp(
ui = f7Page(
title = "My app",
f7SingleLayout(
navbar = f7Navbar(
title = "f7Searchbar",
hairline = FALSE,
shadow = TRUE,
subNavbar = f7SubNavbar(
f7Searchbar(id = "search1")
)
),
f7Block(
"This block will be hidden on search.
Lorem ipsum dolor sit amet, consectetur adipisicing elit."
) %>% f7HideOnSearch(),
f7List(
lapply(seq_along(cars), function(i) {
f7ListItem(cars[i])
})
) %>% f7Found(),
f7Block(
p("Nothing found")
) %>% f7NotFound()
)
),
server = function(input, output) {}
)
# Expandable searchbar with trigger
cities <- names(precip)
shiny::shinyApp(
ui = f7Page(
title = "My app",
f7SingleLayout(
navbar = f7Navbar(
title = "f7Searchbar with trigger",
hairline = FALSE,
shadow = TRUE,
f7SearchbarTrigger(targetId = "search1"),
subNavbar = f7SubNavbar(
f7Searchbar(id = "search1", expandable = TRUE)
)
),
f7Block(
"This block will be hidden on search.
Lorem ipsum dolor sit amet, consectetur adipisicing elit."
) %>% f7HideOnSearch(),
f7List(
lapply(seq_along(cities), function(i) {
f7ListItem(cities[i])
})
) %>% f7Found(),
f7Block(
p("Nothing found")
) %>% f7NotFound()
)
),
server = function(input, output) {}
)
# Searchbar in \link{f7Appbar}
shiny::shinyApp(
ui = f7Page(
title = "My app",
f7Appbar(
f7Searchbar(id = "search1", inline = TRUE)
),
f7SingleLayout(
navbar = f7Navbar(
title = "f7Searchbar in f7Appbar",
hairline = FALSE,
shadow = TRUE
),
f7List(
lapply(seq_along(cities), function(i) {
f7ListItem(cities[i])
})
) %>% f7Found()
)
),
server = function(input, output) {}
)
}
# }
Run the code above in your browser using DataLab