Description Usage Arguments Buttons Panels Colors Examples
The background()
function adjusts the background color of a tag element.
1 | background(x, color)
|
x |
A tag element or .style pronoun. |
color |
One of |
Use background()
to modify shiny’s action buttons.
actionButton("id", "Take action") %>% background("green")
With a couple other functions we can take our improvement a step further.
actionButton("id", "Take action") %>% background("green") %>% border("green") %>% shadow("small")
Shiny’s download buttons include ...
, so we can use the .style
pronoun!
downloadButton( .style %>% background("white") %>% border("blue"), outputId = "dwnld", label = "Do a download", class = NULL )
sidebarLayout( sidebarPanel( .style %>% background("blue"), "It's alive" ), mainPanel( .style %>% background("red"), "It's panel" ) )
It’s panel
blue
indigo
purple
red
orange
yellow
green
teal
cyan
white
transparent
1 2 3 4 5 6 7 8 9 10 | library(htmltools)
div(
.style %>%
background("white") %>%
border("blue") %>%
text("white"),
"Nunc porta vulputate tellus.",
"Suspendisse potenti."
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.