affix: Position

Description Usage Arguments See Also Examples

View source: R/design.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
### Affix an element

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

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