Learn R Programming

yonder (version 0.2.0)

affix: Position

Description

The affix utility function applies Bootstrap classes to fix elements to the top or bottom of a page. Use "sticky" to cause an element to fix to the top of a page after the element is scrolled past. Important, the IE11 and Edge browsers do not support the sticky behavior.

Usage

affix(tag, position)

Arguments

tag

A tag element.

position

One of "top", "bottom", or "sticky" specifying the fixed behavior of an element.

See Also

Other design utilities: active(), background(), border(), display(), float(), font(), height(), padding(), scroll(), shadow(), width()

Examples

Run this code
# NOT RUN {
### Affix an element

div(
  span("I'm up here!") %>%
    padding(left = 3, right = 3) %>%
    background("teal")
) %>%
  display("flex") %>%
  flex(justify = "center") %>%
  affix("top")

# }

Run the code above in your browser using DataLab