Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Change the size of an icon in shiny dashboard

How can I change the size of an icon() in shiny dashboard?

library(shiny)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPage(skin = "purple",
                     options = list(sidebarExpandOnHover = TRUE),
                     header = dashboardHeader(
                       controlbarIcon = shiny::icon("filter")
                     ),
                     sidebar = dashboardSidebar(),
                     body = dashboardBody(
                       tags$style(".fa-filter {color:red;size:26px}"),
                       
                     ),
                     controlbar = dashboardControlbar(
                       id = "controlbar",
                       collapsed = FALSE,
                       overlay = TRUE, 
                       skin = "light",
                       pinned = T
                     )
  ),
  server = function(input, output, session) {
  }
)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You have to set the CSS property font-size instead of size:

library(shiny)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPage(
    skin = "purple",
    options = list(sidebarExpandOnHover = TRUE),
    header = dashboardHeader(
      controlbarIcon = shiny::icon("filter")
    ),
    sidebar = dashboardSidebar(),
    body = shinydashboard::dashboardBody(
      tags$style(".fa-filter {color:red; font-size:26px}"),
    ),
    controlbar = dashboardControlbar(
      id = "controlbar",
      collapsed = FALSE,
      overlay = TRUE,
      skin = "light",
      pinned = T
    )
  ),
  server = function(input, output, session) {
  }
)
#> 
#> Listening on http://127.0.0.1:6563

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading