Reputation: 8404
After converting my shiny application to shiny dashboard I noticed that the label of the download button has turned into a grey color that is not easily read. How can I set the color of it? Can I do the same with the icon inside the button as well?
#ui.r
library(shiny)
library(shinydashboard)
shinyUI( dashboardPage(
dashboardHeader(
title="Styling Download Button"
),
dashboardSidebar(
downloadButton("download1", label="Download with style", class = "butt1"),
# style font family as well in addition to background and font color
tags$head(tags$style(".butt1{background-color:orange;} .butt1{color: black;} .butt1{font-family: Courier New}"))
),
dashboardBody()
))
#server.r
shinyServer(function(input, output) {
})
Upvotes: 0
Views: 2230
Reputation: 29387
This should do the job
library(shiny)
library(shinydashboard)
ui <- shinyUI( dashboardPage(
dashboardHeader(
title="Styling Download Button"
),
dashboardSidebar(
tags$style(type="text/css", "#download1 {background-color:orange;color: black;font-family: Courier New}"),
downloadButton("download1", label="Download with style", class = "butt1")
),
dashboardBody()
))
#server.r
server <- shinyServer(function(input, output) {})
shinyApp(ui, server)
Upvotes: 4