2
votes

Hello I am working on Shiny Dashboard. The following article helped me to add an icon to the fileInput in shiny.

Adding/removing icon in downloadButton() and fileInput()

I was hoping if there is a way to add icons to selectInput as well in shiny. I want to maintain a consistency of icons in my sidebar menu.

I tried using the below code however it does not serve the purpose

sidebarItem(selectInput("vars", "Select a variable:",choices=c("Users", 
"New_Users"), multiple=F), icon = icon("paw"), tabName = "")

I am really hoping if there is a solution to this.

Thanks a lot in advance!!

1

1 Answers

3
votes

Use the same approach, set the label a as list with an icon and a string.

sidebarItem(selectInput("vars", list(icon("paw"),"Select a variable:"),choices=c("Users", 
    "New_Users"), multiple=F))