bulmaModal: Modal

Description Usage Arguments Examples

View source: R/bulma-modal.R

Description

Display a modal

Usage

1
bulmaModal(id, options, session = shiny::getDefaultReactiveDomain())

Arguments

id

Unique modal id.

options

Modal configuration. See https://github.com/VizuaaLOG/BulmaJS.

session

A valid shiny session.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
library(shiny)
ui <- bulmaPage(
 bulmaActionButton("show_modal", "Show modal"),
 bulmaActionButton("show_modal2", "Show modal 2")
)

server <- function(input, output){
 observeEvent(input$show_modal, {
   bulmaModal(
    id = "mymodal", 
    list(
     title = "Modal title",
     body = "Modal content"
    )
   )
 })
 observeEvent(input$show_modal2, {
   bulmaModal(
    id = "mymodal2", 
    list(
     title = "Modal title 2",
     body = "Modal content 2"
    )
   )
 })
}

if(interactive())
 shinyApp(ui, server)

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