Learn R Programming

shinyMobile (version 0.1.0)

f7SmartSelect: Create a Framework7 smart select

Description

It is nicer than the classic f7Select and allows for search.

Usage

f7SmartSelect(
  inputId,
  label,
  choices,
  selected = NULL,
  type = c("sheet", "popup", "popover"),
  smart = TRUE,
  multiple = FALSE
)

Arguments

inputId

Select input id.

label

Select input label.

choices

Select input choices.

selected

Default selected item.

type

Smart select type: either c("sheet", "popup", "popover"). Note that the search bar is only available when the type is popup.

smart

Whether to enable the search bar. TRUE by default.

multiple

Whether to allow multiple values. FALSE by default.

Examples

Run this code
# NOT RUN {
if (interactive()) {
library(shiny)
library(shinyMobile)

 shinyApp(
   ui = f7Page(
     title = "My app",
     f7SingleLayout(
       navbar = f7Navbar(title = "f7SmartSelect"),
       f7SmartSelect(
         inputId = "variable",
         label = "Choose a variable:",
         selected = "drat",
         choices = colnames(mtcars)[-1],
         type = "popup"
       ),
       tableOutput("data")
     )
   ),
   server = function(input, output) {
     output$data <- renderTable({
       mtcars[, c("mpg", input$variable), drop = FALSE]
     }, rownames = TRUE)
   }
 )
}
# }

Run the code above in your browser using DataLab