library(shiny)
library(shinyMobile)
app <- shiny::shinyApp(
ui = f7Page(
title = "Update f7Button",
f7SingleLayout(
navbar = f7Navbar(title = "Update f7Button"),
f7Block(f7Button("update", "Update Button")),
f7Block(
f7Button(
"button",
"My button",
color = "orange",
outline = FALSE,
fill = TRUE,
shadow = FALSE,
rounded = FALSE,
icon = f7Icon("speedometer")
)
)
)
),
server = function(input, output, session) {
observeEvent(input$update, {
updateF7Button(
inputId = "button",
label = "Updated label",
color = "purple",
shadow = TRUE,
rounded = TRUE,
outline = TRUE,
fill = FALSE,
tonal = TRUE,
size = "large",
icon = f7Icon("speaker_zzz")
)
})
}
)
if (interactive() || identical(Sys.getenv("TESTTHAT"), "true")) app
if (interactive()) {
library(shiny)
library(shinyMobile)
shinyApp(
ui = f7Page(
options = list(dark = FALSE),
title = "Button Segments",
f7SingleLayout(
navbar = f7Navbar(title = "f7Segment, f7Button"),
f7BlockTitle(title = "Simple Buttons in a segment"),
f7Segment(
f7Button(color = "blue", label = "My button", fill = FALSE),
f7Button(color = "green", label = "My button", fill = FALSE),
f7Button(color = "yellow", label = "My button", fill = FALSE)
),
f7BlockTitle(title = "Tonal buttons"),
f7Segment(
f7Button(color = "blue", label = "My button", tonal = TRUE),
f7Button(color = "green", label = "My button", tonal = TRUE),
f7Button(color = "yellow", label = "My button", tonal = TRUE)
),
f7BlockTitle(title = "Filled Buttons in a segment/rounded container"),
f7Segment(
rounded = TRUE,
f7Button(color = "black", label = "My button"),
f7Button(color = "green", label = "My button"),
f7Button(color = "yellow", label = "My button")
),
f7BlockTitle(title = "Outline Buttons in a segment/shadow container"),
f7Segment(
shadow = TRUE,
f7Button(label = "My button", outline = TRUE, fill = FALSE),
f7Button(label = "My button", outline = TRUE, fill = FALSE),
f7Button(label = "My button", outline = TRUE, fill = FALSE)
),
f7BlockTitle(title = "Buttons in a segment/strong container"),
f7Segment(
strong = TRUE,
f7Button(label = "My button", fill = FALSE),
f7Button(label = "My button", fill = FALSE),
f7Button(label = "My button", fill = FALSE, active = TRUE)
)
)
),
server = function(input, output) {}
)
}
Run the code above in your browser using DataLab