Buttons

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
)

Panels

sidebarLayout(
  sidebarPanel(
    .style %>%
      background("blue"),
    "It's alive"
  ),
  mainPanel(
    .style %>%
      background("red"),
    "It's panel"
  )
)

Colors

div(
  .style %>%
    display("flex") %>%
    flex(justify = "between", wrap = TRUE),
  lapply(names(background_color_), function(color) {
    div(
      .style %>%
        margin(3),
      div(color) %>% text(align = "center"),
      div(
        .style %>%
          padding(5) %>%
          background(color)
      )
    )
  })
)


Try the cascadess package in your browser

Any scripts or data that you put into this service are public.

cascadess documentation built on Jan. 13, 2021, 5:10 p.m.