Skip to contents

Add a tooltip to an element by attaching data-tooltip attributes.

Usage

ds_tooltip(tag, text, placement = "top")

Arguments

tag

The element to attach the tooltip to.

text

The tooltip text.

placement

Tooltip placement: "top", "bottom", "left", or "right".

Value

The element with tooltip attributes added.

Examples

ds_tooltip(
  ds_button("Hover me"),
  text = "This is helpful information"
)
#> <button class="ds-button" type="button" data-tooltip="This is helpful information" data-tooltip-placement="top">Hover me</button>