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 :
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
