A template is a list of blocks, shown in order. Name it with
tip_define() and use the name in tip_on(), or give
the template itself to template = of tip_on(). A block can be made with tip_title() and the other block
functions, or written as a plain list such as list(type = "text", text = "..."); both are checked in the same way.
Arguments
- ...
One or more blocks in order (cannot be named; use
head,bodyandfootfor slots).- head
Optional block or list of blocks drawn at the top of the tip (for example a
tip_title()and atip_badge()).- body
Optional block or list of blocks drawn in the middle of the tip. Cannot be combined with
....- foot
Optional block or list of blocks drawn at the bottom of the tip below a subtle divider.
Value
A template, to give to tip_define() or to template = of tip_on().
Details
Blocks can be given in order through ..., or placed into the named slots head, body and foot. Each slot
takes one block or a list of blocks; foot is drawn below a thin divider in muted text, suited for a source line or
footnote. Do not pass both positional blocks in ... and body.
See also
Other tooltips:
tip_blocks,
tip_define(),
tip_marker(),
tip_more(),
tip_on(),
tip_output(),
tip_presets(),
tip_server,
tip_spec(),
tip_style(),
tip_table(),
tip_theme(),
use_hovercraft()
Examples
tip_template(
tip_title("{{ label }}"),
tip_text("{{ differences | number:0 }} differences"),
list(type = "badge", text = "{{ status }}")
)
#> <tip template: title, text, badge>
tip_template(
head = list(tip_title("{{ label }}"), tip_badge("{{ status }}", status = "{{ tone }}")),
body = tip_fields(Records = "{{ records | number:0 }}"),
foot = tip_text("Source: {{ source }}")
)
#> <tip template: head(title, badge), body(fields), foot(text)>