# NOT RUN {
if (interactive()) {
library(shiny)
library(shinyMobile)
shiny::shinyApp(
ui = f7Page(
title = "My app",
f7SingleLayout(
navbar = f7Navbar(title = "f7ValidateInput"),
f7Text(
inputId = "caption",
label = "Caption",
value = "Data Summary"
),
verbatimTextOutput("value"),
hr(),
f7Text(
inputId = "caption2",
label = "Enter a number",
value = 1
)
)
),
server = function(input, output, session) {
observe({
f7ValidateInput(inputId = "caption", info = "Whatever")
f7ValidateInput(
inputId = "caption2",
pattern = "[0-9]*",
error = "Only numbers please!"
)
})
output$value <- renderPrint({ input$caption })
}
)
}
# }
Run the code above in your browser using DataLab