简体   繁体   中英

Icon not appearing in shinydashboardPlus::boxDropdown()

I was trying to implement the below icon into the shiny app.

在此处输入图像描述

But the icon is appearing. I was trying with the below shiny code.

library(shiny)
library(shinydashboard)

shinyApp(fluidPage(    
  
  # Give the page a title
  titlePanel("Telephones by region"),
  
  # Generate a row with a sidebar
  sidebarLayout(      
    
    # Define the sidebar with one input
    sidebarPanel(
      selectInput("region", "Region:", 
                  choices=colnames(WorldPhones)),
      hr(),
      helpText("Data from AT&T (1961) The World's Telephones.")
    ),
    
    # Create a spot for the barplot
    mainPanel(
      shinydashboardPlus::box(
        # Analysis UI Module function and arguments from JSON file
        plotOutput("phonePlot"),
        title = "Hi!",
        width = 12,
        closable = TRUE,
        collapsible = TRUE,
        dropdownMenu = shinydashboardPlus::boxDropdown(
          shinydashboardPlus::boxDropdownItem("Hi!"),
          shinydashboardPlus::boxDropdownItem("Hello!"),
          icon = icon("circle-ellipsis")
        )
      ) 
    )
    
  )
),

# Define a server for the Shiny app
function(input, output) {
  
  # Fill in the spot we created for a plot
  output$phonePlot <- renderPlot({
    
    # Render a barplot
    barplot(WorldPhones[,input$region]*1000, 
            main=input$region,
            ylab="Number of Telephones",
            xlab="Year")
  })
})

I am trying with 'circle-ellipsis' icon, it is also not working with the only 'ellipsis' icon. Any suggestion is highly appreciated.

You can use icon("ellipsis-h") instead. shiny::icon supports icons from FontAwesome versions 4 and 5. You can search for these icons here:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM