Learn R Programming

shinyMobile (version 0.7.0)

f7Radio: Create an f7 radio button input

Description

Create an f7 radio button input

Usage

f7Radio(inputId, label, choices = NULL, selected = NULL)

Arguments

inputId

Radio input id.

label

Radio label

choices

List of choices.

selected

Selected element. NULL by default.

Examples

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

 shiny::shinyApp(
   ui = f7Page(
    title = "My app",
    f7SingleLayout(
     navbar = f7Navbar(title = "f7Radio"),
     f7Radio(
      inputId = "radio",
      label = "Choose a fruit:",
      choices = c("banana", "apple", "peach"),
      selected = "apple"
     ),
     plotOutput("plot")
    )
   ),
   server = function(input, output) {
    output$plot <- renderPlot({
     if (input$radio == "apple") hist(mtcars[, "mpg"])
    })
   }
 )
}
# }

Run the code above in your browser using DataLab