Skip to contents

f7Button generates a Framework7 action button.

updateF7Button updates an f7Button.

Usage

f7Button(
  inputId = NULL,
  label = NULL,
  href = NULL,
  color = NULL,
  fill = TRUE,
  outline = FALSE,
  shadow = FALSE,
  rounded = FALSE,
  size = NULL,
  active = FALSE
)

updateF7Button(
  inputId,
  label = NULL,
  color = NULL,
  fill = NULL,
  outline = NULL,
  shadow = NULL,
  rounded = NULL,
  size = NULL,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

inputId

The input slot that will be used to access the value.

label

The contents of the button or link–usually a text label, but you could also use any other HTML, like an image or f7Icon.

href

Button link.

color

Button color. Not compatible with outline. See here for valid colors https://framework7.io/docs/badge.html.

fill

Fill style. TRUE by default. Not compatible with outline

outline

Outline style. FALSE by default. Not compatible with fill.

shadow

Button shadow. FALSE by default. Only for material design.

rounded

Round style. FALSE by default.

size

Button size. NULL by default but also "large" or "small".

active

Button active state. Default to FALSE. This is useful when used in f7Segment with the strong parameter set to TRUE.

session

The Shiny session object, usually the default value will suffice.

Author

David Granjon, dgranjon@ymail.com

Examples

if (interactive()) {
 library(shiny)
 library(shinyMobile)

 shiny::shinyApp(
  ui = f7Page(
    title = "Update f7Button",
    f7SingleLayout(
      navbar = f7Navbar(title = "Update f7Button"),
      f7Button(
        "test",
        "Test",
        color = "orange",
        outline = FALSE,
        fill = TRUE,
        shadow = FALSE,
        rounded = FALSE,
        size = NULL),
      f7Toggle("prout", "Update Button")
    )
  ),
  server = function(input, output, session) {
    observe(print(input$test))
    observeEvent(input$prout, {
      if (input$prout) {
        updateF7Button(
          inputId = "test",
          label = "Updated",
          color = "purple",
          shadow = TRUE,
          rounded = TRUE,
          size = "large"
        )
      }
    })
  }
 )
}