How can I insert and display icons on a selectInput?

Hello RStudio Community :wave:, I am interested in setting and displaying icons on items in a selectInput(). Sadly, I haven't found out how to achieve this. I was wondering if somebody here has achieved this, thanks.

Here is a sample Shiny App with the idea (although it doesn't work as expected):

library(shiny)
library(shinyWidgets)

ui <- fluidPage(
  selectInput("si", "Select Input:",
              c(paste("item1", icon("gem")), "item2", "item3")
              ),
  
  p("This is a Font Awesome icon: ",  icon("gem"))
)

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

shinyApp(ui, server)

The icon("gem") on the selectInput() just displays the raw html code <i class="fa fa-gem"></i>

This topic was automatically closed 54 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.