[英]How do you change the color of an icon in an R Shiny app?
我有一個Shiny應用程序,它使用UI中Font Awesome庫(內置)中的幾個圖標:
icon("bolt")
icon("compass")
如何更改每個圖標的顏色?
在UI的開頭,插入tags$style(".fa-bolt {color:#E87722}")
來更改螺栓圖標的顏色。 同樣,添加tags$style(".fa-compass {color:#E87722}")
以更改羅盤圖標的顏色。 這將應用着色應用程序中的所有螺栓圖標和指南針圖標。
你可以使用HTML標簽而不是使用icon()
tags$i(
class = "fa fa-check-square",
style = "color: rgb(0,166,90)"
)
例如
library(shiny)
ui <- fluidPage(
tags$p("icon:"),
tags$hr(),
tags$i(
class = "fa fa-check-square",
style = "color: rgb(0,166,90)"
),
icon("check-square")
)
server <- function(input, output, session) {
}
shinyApp(ui, server)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.