Buttons

Use background_*() to modify shiny's action buttons.

actionButton("ab1", "Take action") %>%
  background_color("info")

With a couple other functions we can take our improvement a step further.

actionButton("ab1", "Take action") %>%
  background_color("info") %>%
  border_color("info") %>%
  shadow("small")

Shiny's download buttons include ..., so we can use the .style pronoun!

downloadButton(
  .style %>%
    background_color("secondary") %>%
    border_color("secondary"),
  outputId = "db1",
  label = "Download",
  class = NULL
)

Panels

sidebarLayout(
  sidebarPanel(
    .style %>%
      background_color("primary"),
    "Sidebar panel"
  ),
  mainPanel(
    .style %>%
      background_color("secondary"),
    "Main panel"
  )
)

Colors

div(
  .style %>%
    flex_display() %>%
    flex_justify("between") %>%
    flex_wrap(),
  lapply(names(background_color_values), function(color) {
    div(
      .style %>%
        margin(3),
      div(
        .style %>%
          text_align("center"),
        color
      ),
      div(
        .style %>%
          padding(5) %>%
          background_color(color)
      )
    )
  })
)


Try the cascadess package in your browser

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

cascadess documentation built on Oct. 30, 2024, 9:29 a.m.