how to use my own icon in a shiny app menu item

36 views
Skip to first unread message

Matthew Cserhati

unread,
Oct 26, 2022, 8:24:06 PM10/26/22
to Shiny - Web Framework for R
Hello shinyers!

I made a 16x16 .ico file to use as my own icon in a menu item.

I have this code in my app:

menuItem("Inventory", tabName="tab3", icon=icon("users"),

How do I replace the generic 'users' icon with my own?

Thanks, Matthew

Ehsan Zangeneh

unread,
Oct 27, 2022, 8:18:05 PM10/27/22
to Shiny - Web Framework for R
Hi Matthew
This is not exactly what you want but then it helps me to solve a similar issue, in this ( https://apsic.scicore.unibas.ch/ ) project in the sidebar as you can see there are some little png pics that are approximately 150*150 pixels.
On the server side I used an HTML-like code as follows:

output$imageBody <- renderImage({
  if (input$cancer == "Breast:Carcinoma") {
    return(list(
      src = "body/breast.png",
      contentType = "image/png",width = "100%", height = "100%",
      alt = "Breast"
    ))}
)}
It is free of icon size limitations and it is easy to convert pictures of other formats into png same size.
 
I hope it helps

BR
Ehsan


Reply all
Reply to author
Forward
0 new messages