Is there any chance to not only use html in the text but in the button of sendweetalert
or confirmsweetalert
in the shinyWidgets
package?
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
tags$h1("Confirm sweet alert"),
actionButton(
inputId = "launch1",
label = "Confirmation"
),
verbatimTextOutput(outputId = "res1"),
tags$br(),
actionButton(
inputId = "launch2",
label = "Sweetalert"
),
verbatimTextOutput(outputId = "res2")
)
server <- function(input, output, session) {
observeEvent(input$launch1, {
confirmSweetAlert(
session,
inputId = "confirm",
btn_labels = HTML("<a href='https://google.de'>Link</a>"),
title = "confirmation",
html = T
)
})
output$res1 <- renderPrint(input$confirm)
observeEvent(input$launch2, {
sendSweetAlert(
session,
title = "sweetalert",
html = T,
btn_labels = HTML("<a href='https://google.de'>Link</a>")
)
})
}
shinyApp(ui = ui, server = server)