shadow: Shadows

Description Usage Arguments See Also Examples

View source: R/design.R

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

1
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 utilities: active(), affix(), background(), border(), display(), float(), font(), height(), padding(), scroll(), width()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
### 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")

yonder documentation built on Jan. 11, 2020, 9:35 a.m.