Hello RStudio Community , I want to display icons on the choices of 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)
ui <- fluidPage(
selectInput(
inputId = "si",
label = "Select Input:",
choices = c(
paste("item1", icon("gem")),
"item2",
"item3"
)
),
p("This is a Font Awesome icon (I want at the right side of 'item1'): ", icon("crown"))
)
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>
.
My result is this:
What I want is to include the icon as part of the choice on the select input, kinda like the next example:
Is this even possible in Shiny? Thanks.