Home > database >  Putting a link in the content of a shinyhelper
Putting a link in the content of a shinyhelper

Time:08-04

I'm trying to put a link in the content of a shinyhelper popup. Is there a way to do this? See here for more information on shinyhelper.

I tried the following:

   box( title = "Plot title",
        status = NULL,
        solidHeader = FALSE, 
        withLoader(plotlyOutput(ns("my_plot"),
                                height = 250),
                   type = "html",
                   loader = "loader3")
      ) %>%
        helper(
          colour = "black",
          type = "inline",
          size = "m",
          title = "Helper title",
          content = c("Content part 1",
                    "For more information about this topic, see " ,
                    tags$a("here.", href= "https://cran.r-project.org/web/packages/shinyhelper/shinyhelper.pdf",
                    target="_blank")))

but that didn't work

CodePudding user response:

library(shiny)
library(shinyhelper)
library(magrittr)

ui <- fluidPage(
  sliderInput("slider", "Slide me!", 1, 10, 5) %>%
    helper(
      colour = "black",
      type = "inline",
      size = "m",
      title = "Helper title",
      content = HTML(
        "Content part 1. ",
        "For more information about this topic, see " ,
        as.character(tags$a(
          "here.", 
          href= "https://cran.r-project.org/web/packages/shinyhelper/shinyhelper.pdf",
          target="_blank"
        ))
      )
    )
)

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

shinyApp(ui, server)
  • Related