Skip to content

It is often useful to print out a list of items, tasks a function or package performs, or a list of notes.

Usage

cli_bullets(text, id = NULL, class = NULL, .envir = parent.frame())

Arguments

text

Character vector of items. See details below on how names are interpreted.

id

Optional id of the div.bullets element, can be used in themes.

class

Optional additional class(es) for the div.bullets element.

.envir

Environment to evaluate the glue expressions in.

Details

Items may be formatted differently, e.g. they can have a prefix symbol. Formatting is specified by the names of text, and can be themed. cli creates a div element of class bullets for the whole bullet list. Each item is another div element of class bullet-<name>, where <name> is the name of the entry in text. Entries in text without a name create a div element of class bullet-empty, and if the name is a single space character, the class is bullet-space.

The built-in theme defines the following item types:

You can define new item type by simply defining theming for the corresponding bullet-<name> classes.

cli_bullets(c(
        "noindent",
  " " = "indent",
  "*" = "bullet",
  ">" = "arrow",
  "v" = "success",
  "x" = "danger",
  "!" = "warning",
  "i" = "info"
))

#> noindent
#>   indent
#>  bullet
#> → arrow
#>  success
#>  danger
#> ! warning
#>  info