Learn R Programming

yonder (version 0.1.0)

shadow: Add shadows to tag elements

Description

The shadow utility applies a shadow to a tag element. Elements with a shadow may appear to pop off the page. The material design set of components, used on Android and for Google applications, commonly uses shadowing. Although "none" is an allowed size, most elements do not have a shadow by default.

Usage

shadow(tag, size = "regular")

Arguments

tag

A tag element.

size

One of "none", "small", "regular", or "large" specifying the amount of shadow added, defaults to "regular".

See Also

Other design: active, affix, background, border, display, float, font, height, padding, scroll, width

Examples

Run this code
# NOT RUN {
### Styling a navbar

div(
  navbar(brand = "Navbar") %>%
    background("cyan") %>%
    shadow("small") %>%
    margin(bottom = 3),
  p(
    "Cras mattis consectetur purus sit amet fermentum. Donec sed ",
    "odio dui. Lorem ipsum dolor sit amet, consectetur adipiscing ",
    "elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam ",
    "venenatis vestibulum."
  )
)

### Different shadows

div(
  lapply(
    c("small", "regular", "large"),
    shadow,
    tag = div() %>%
      padding(5) %>%
      margin(2)
  )
) %>%
  display("flex")

# }

Run the code above in your browser using DataLab