bulmaNotification: bulma notification

Description Usage Arguments Author(s) Examples

View source: R/bulma-notification.R

Description

Create a notification box https://bulma.io/documentation/elements/notification/.

Usage

1
2
3
4
5
bulmaNotification(
  id = NULL,
  options = NULL,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

id

Notification target. It will be attached on the provided DOM element. If id is NULL, the notification is attached to the body.

options

A list of notification options. See https://github.com/VizuaaLOG/BulmaJS.

session

A valid shiny session.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
if (interactive()) {
 library(shiny)

 ui <- bulmaPage(
  bulmaActionButton("show_notif", "Show notification"),
  div(id = "target", style = "top: 0px; right: 0px; position: absolute;")
 )
 
 server <- function(input, output, session) {
  observeEvent(input$show_notif, {
    bulmaNotification(
      id = "target", 
      options = list(
        body = "This is the message",
        color = "info",
        dismissInterval = 200000,
        isDismissable = TRUE
      )
    )
  })
 }
 shinyApp(ui, server)
}

JohnCoene/shinybulma documentation built on Nov. 23, 2021, 6:20 p.m.