Learn R Programming

shinyMobile (version 0.7.0)

f7Toast: Create a Framework7 toast

Description

Create a Framework7 toast

Usage

f7Toast(
  session,
  text,
  position = c("bottom", "top", "center"),
  closeButton = TRUE,
  closeButtonText = "close",
  closeButtonColor = "red",
  closeTimeout = 3000,
  icon = NULL
)

Arguments

session

Shiny session.

text

Toast content.

position

Toast position c("bottom", "top", "center").

closeButton

Whether to close the toast with a button. TRUE by default.

closeButtonText

Close button text.

closeButtonColor

Close button color.

closeTimeout

Time before toast closes.

icon

Optional. Expect f7Icon. Warning: Adding icon will hide the close button.

Examples

Run this code
# NOT RUN {
if (interactive()) {
 library(shiny)
 library(shinyMobile)
 shinyApp(
  ui = f7Page(
    title = "My app",
    f7SingleLayout(
      navbar = f7Navbar(title = "f7Toast"),
      f7Button(inputId = "toast", label = "Open Toast")
    )
  ),
  server = function(input, output, session) {
    observeEvent(input$toast, {
      f7Toast(
        session,
        position = "top",
        text = "I am a toast. Eat me!"
      )
    })
  }
 )
}
# }

Run the code above in your browser using DataLab