downloadLink does not render icon, but other similar elements do

How can I get an icon to render with downloadLink, just like for actionLink, downloadButton, and actionButton ?

library(shiny)

ui <- pageWithSidebar(
  
  headerPanel("My Header"),
  sidebarPanel(),
  mainPanel(
    actionButton(inputId = "myactionButton",
                 label="my action button",
                 icon=icon("home")),
    HTML("<br>"),
    actionLink(inputId = "myactionLink",
                 label="my action link",
                 icon=icon("home")),
    HTML("<br>"),
    downloadButton(outputId = "mydownloadButton",
                   label = "my download button",
                   icon=icon("home")),
    HTML("<br>"),
    downloadLink(outputId = "mydownloadLink",
                 label = "my download link",
                 icon=icon("home"))
  )
)

server <- function(input, output) {

}

shinyApp(ui, server)

image

The icon will appear by adding some HTML to the label argument.

downloadLink(outputId = "mydownloadLink",
                 label = HTML('<i class="fa fa-home"></i> my download link')
                 )

image

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.