使用CSS或参数来增加shiny应用程序中`icon()`的大小。

huangapple go评论98阅读模式
英文:

How to increase the icon() size in a shiny app using css or parameter

问题

你想增加shiny应用中icon()的大小,你可以使用以下代码:

  1. library(shiny)
  2. ui <- fluidPage(
  3. tags$head(
  4. tags$link(rel = "stylesheet", type = "text/css", href = "styles.css")
  5. ),
  6. # 你的UI代码的其余部分
  7. icon("square_check", class = "fa", style = "font-size: 24px;") # 通过添加style属性来增加图标大小
  8. # ...
  9. )
  10. server <- function(input, output) {
  11. # 服务器端代码
  12. # ...
  13. }
  14. shinyApp(ui, server)

这段代码中,通过在icon()函数中添加style属性并设置font-size来增加图标的大小。

英文:

How can I increase the size of the icon() in a shiny app

  1. library(shiny)
  2. ui &lt;- fluidPage(
  3. tags$head(
  4. tags$link(rel = &quot;stylesheet&quot;, type = &quot;text/css&quot;, href = &quot;styles.css&quot;)
  5. ),
  6. # Rest of your UI code
  7. icon(&quot;square_check&quot;, class = &quot;fa&quot;) # Apply the &quot;fa&quot; class to the icon
  8. # ...
  9. )
  10. server &lt;- function(input, output) {
  11. # Server code
  12. # ...
  13. }
  14. shinyApp(ui, server)

答案1

得分: 2

你可以尝试:

  1. icon("square_check", class = "fa", style = "font-size: 30px;")
英文:

You can try

  1. icon(&quot;square_check&quot;, class = &quot;fa&quot;, style = &quot;font-size: 30px;&quot;)

答案2

得分: 1

The css property is font-size

  1. library(shiny)
  2. ui &lt;- fluidPage(
  3. icon(&quot;home&quot;),
  4. icon(&quot;home&quot;, style = &quot;font-size: 24px;&quot;),
  5. icon(&quot;home&quot;, style = &quot;font-size: 40px;&quot;)
  6. )
  7. server &lt;- function(input, output) {
  8. # 服务器代码
  9. # ...
  10. }
  11. shinyApp(ui, server)

使用CSS或参数来增加shiny应用程序中`icon()`的大小。

英文:

The css property is font-size

  1. library(shiny)
  2. ui &lt;- fluidPage(
  3. icon(&quot;home&quot;),
  4. icon(&quot;home&quot;, style = &quot;font-size: 24px;&quot;),
  5. icon(&quot;home&quot;, style = &quot;font-size: 40px;&quot;)
  6. )
  7. server &lt;- function(input, output) {
  8. # Server code
  9. # ...
  10. }
  11. shinyApp(ui, server)

使用CSS或参数来增加shiny应用程序中`icon()`的大小。

huangapple
  • 本文由 发表于 2023年5月25日 20:17:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/76332192.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定