Skip to contents

This will display a toast prompting the user to enable (or disable) tracking if it is not already enabled. Place this function in your UI.

Usage

trackingToastBS5(
  position = c("top-right", "top-left", "bottom-left", "bottom-right", "bottom", "top"),
  prompt = "Enable cookie tracking?",
  accept = "Accept",
  reject = "Reject",
  auto_hide = FALSE,
  delay = 5000L,
  animation = TRUE,
  background = c("", "white", "dark", "success", "danger", "warning", "info", "primary",
    "secondary"),
  full_width = FALSE,
  enable_opts = list()
)

Arguments

position

Position of toast

prompt

Text to display.

accept, reject

Test to display on buttons.

auto_hide

Whether to automatically hide the toast.

delay

Delay before the toast is hidden, only applies if auto_hide is TRUE.

animation

Whether to animate the prompt.

background

Background color of the toast.

full_width

Whether to show the toast in full width.

enable_opts

Options to pass to shinymetrics_enable().

Note

You can build your own fully custom prompt this is here for convenience should you not want to do so.