Learn R Programming

shinyMobile (version 0.7.0)

f7Swipeout: Create a framework7 swipeout element

Description

To be used in combination with f7ListItem

Usage

f7Swipeout(
  tag,
  ...,
  left = NULL,
  right = NULL,
  side = c("left", "right", "both")
)

Arguments

tag

Tag to be swiped.

...

When side is either "right" or "left" use this slot to pass f7SwipeoutItem.

left

When side is "both", put the left f7SwipeoutItem.

right

When side is "both", put the right f7SwipeoutItem.

side

On which side to swipe: "left", "right" or "both".

Examples

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

 shiny::shinyApp(
   ui = f7Page(
     title = "My app",
     f7SingleLayout(
       navbar = f7Navbar(title = "f7List"),
       # simple list
       f7List(
         lapply(1:3, function(j) {
           if (j == 1) {
             f7Swipeout(
               tag = f7ListItem(letters[j]),
               side = "left",
               f7SwipeoutItem(id = "alert", color = "pink", "Alert"),
               f7SwipeoutItem(id = "notification", color = "green", "Notif")
             )
           } else {
             f7ListItem(letters[j])
           }
         })
       )
     )
   ),
   server = function(input, output, session) {
     observe({
       print(input$alert)
       print(input$notification)
     })

     observeEvent(input$notification, {
       f7Notif(
         text = "test",
         icon = f7Icon("bolt_fill"),
         title = "Notification",
         subtitle = "A subtitle",
         titleRightText = "now",
         session = session
       )
     })

     observeEvent(input$alert, {
       f7Dialog(
         title = "Dialog title",
         text = "This is an alert dialog",
         session = session
       )
     })

   }
 )
}
# }

Run the code above in your browser using DataLab