Learn R Programming

shinyMobile (version 0.7.0)

f7Select: Create an f7 select input

Description

Create an f7 select input

Usage

f7Select(inputId, label, choices, selected = NULL, width = NULL)

Arguments

inputId

Select input id.

label

Select input label.

choices

Select input choices.

selected

Select input default selected value.

width

The width of the input, e.g. 400px, or 100%.

Examples

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

 shiny::shinyApp(
   ui = f7Page(
     title = "My app",
     f7SingleLayout(
      navbar = f7Navbar(title = "f7Select"),
      f7Select(
       inputId = "variable",
       label = "Choose a variable:",
       choices = colnames(mtcars)[-1],
       selected = "hp"
      ),
      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