
Last chance! 50% off unlimited learning
Sale ends in
Searchbar to filter elements in a page.
f7SearchbarTrigger: Element that triggers the searchbar.
f7HideOnSearch: elements with such class on page will be hidden during search
f7HideOnEnable: elements with such class on page will be hidden when searchbar is enabled
f7NotFound: elements with such class are hidden by default and become visible when there is not any search results
f7Found: elements with such class are visible by default and become hidden when there is not any search results.
f7SearchIgnore: searchbar will not consider this elements in search results.
f7Searchbar(
id,
placeholder = "Search",
expandable = FALSE,
inline = FALSE,
options = NULL
)f7SearchbarTrigger(targetId)
f7HideOnSearch(tag)
f7HideOnEnable(tag)
f7NotFound(tag)
f7Found(tag)
f7SearchIgnore(tag)
Necessary when using f7SearchbarTrigger. NULL otherwise.
Searchbar placeholder.
Whether to enable the searchbar with a target link, in the navbar. See f7SearchbarTrigger.
Useful to add an f7Searchbar in a navbar. Notice that utilities like f7HideOnSearch and f7NotFound are not compatible with this mode.
Search bar options. See https://framework7.io/docs/searchbar.html#searchbar-parameters. If no options are provided, the searchbar will search in list elements by item title. This may be changed by updating the default searchContainer and searchIn.
Id of the f7Searchbar.
tag to ignore.
library(shiny)
library(shinyMobile)
cities <- names(precip)
app <- shinyApp(
ui = f7Page(
title = "Expandable searchbar",
f7SingleLayout(
navbar = f7Navbar(
title = "f7Searchbar with trigger",
subNavbar = f7SubNavbar(
f7Searchbar(id = "search1", expandable = TRUE)
)
),
f7Block(
f7SearchbarTrigger(targetId = "search1")
) %>% f7HideOnSearch(),
f7List(
lapply(seq_along(cities), function(i) {
f7ListItem(cities[i])
})
) %>% f7Found(),
f7Block(
p("Nothing found")
) %>% f7NotFound()
)
),
server = function(input, output) {}
)
if (interactive() || identical(Sys.getenv("TESTTHAT"), "true")) app
Run the code above in your browser using DataLab