3

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!!

Analytics_TM
  • 493
  • 6
  • 28

1 Answers1

3

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))
Geovany
  • 5,389
  • 21
  • 37
  • Hello Geovany, Thanks a lot for this. It worked like magic!!. I tried to increase the size of the text and the icon, however I am unable to do this. Is there a way to adjust that as well that you can suggest please. – Analytics_TM Mar 14 '19 at 22:43
  • Hello Geovany, Also if I can edit the color of the text and icon as well – Analytics_TM Mar 15 '19 at 01:30
  • I'm glad it works. Please open a new question and indicate if you want to change the font size/color for all the select inputs in your app or just one specific widget. – Geovany Mar 15 '19 at 03:04