position_sticky: Sticky positioning

View source: R/position-sticky.R

position_stickyR Documentation

Sticky positioning

Description

Use position_sticky() to position an element at the top or bottom of the viewport after scrolling past the element.

Usage

position_sticky(x, ...)

Arguments

x

A tag element or .style pronoun.

...

A character string specifying an edge. One of,

  • "bottom"

  • "top"

    Use name-value pairs to specify breakpoints.

Value

An object of the same type as x.

See Also

Other position utilities: position_centered(), position()

Examples


library(htmltools)

div(
  .style %>%
    position_sticky(sm = "top"),
  "Sticks to the top of the viewport on small screens"
)


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