0

Is it possible to create a popup that will welcome a user once they have accessed a shiny dashboard? Additionally, I would like for them to be able to lick a button within the popup window that would close it.

Ideally the pop up would say something along the lines of "Welcome to the _______ Dashboard! If you are ready to continue, press okay!". And the okay button would close the pop up window.

Monty-PYTHON
  • 13
  • 1
  • 7
  • Can this : https://deanattali.com/blog/shinyalert-package/ help you? If not, what code have you already try? – Gainz Jun 26 '19 at 20:24
  • I have tried this code and it works except for the pop up being present when the application is opened, rather than having to press a button for the pop up to appear. ( I want it to be there when the application is accessed without having to press a button). – Monty-PYTHON Jun 26 '19 at 20:26
  • Oh sorry I read your question too fast. – Gainz Jun 26 '19 at 20:27
  • Noo worries!!!! – Monty-PYTHON Jun 26 '19 at 20:28
  • would this help? https://stackoverflow.com/questions/50326110/r-shiny-popup-window-before-app or https://stackoverflow.com/questions/40985684/r-shiny-present-a-shinybs-modal-popup-on-page-visit-no-user-action – Ben Jun 26 '19 at 21:12

1 Answers1

2

Following on from @Gainz' comment, you can use shinyalert, or any other method of showing a modal e.g. showModal(modalDialog(...)).

If you call this inside the server function of your app (without an observe or observeEvent, just as-is), then it will run once per user-session.

Minimal example below:

library(shiny)
library(shinyalert)

ui <- fluidPage(

  useShinyalert()

)

server <- function(input, output, session) {

  shinyalert("Welcome", "Welcome to the ___ Dashboard!", type = "info")

}

shinyApp(ui, server)
cwthom
  • 393
  • 1
  • 13