countup: countup

Description Usage Arguments Details Value Examples

View source: R/countup.R

Description

Count up widget

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
countup(
  count,
  start_at = 0,
  options = NULL,
  duration = 2.5,
  start = TRUE,
  width = NULL,
  height = NULL,
  elementId = NULL
)

Arguments

count

Numeric or integer to count up to (required).

start_at

Integer to start from defaults to 0.

options

List of options (see details and examples).

duration

duration of the count defaults to 2.5.

start

Whether to start the counter.

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

elementId

Specify element id of <span> (optional).

Details

Valid options include:

Value

An object of class countup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
countup(25)

opts <- list(useEasing = TRUE,
             useGrouping = TRUE,
             separator = "'",
             prefix = "US$",
             suffix = " million")

countup(1234, start = 200, options = opts)

## End(Not run)

JohnCoene/countup documentation built on Aug. 24, 2020, 8:58 p.m.