The studio guide for mascot_bubble().
The same page is read in the mascot studio.
Try it live.
The mascot studio shows this function with live controls and the generated code. In an R session with the optional packages bslib and knitr installed, run:
mascot::mascot_studio(fn = "mascot_bubble")
It opens on this function's guide; change a control and watch the mascot.
How long a bubble stays
shown
duration = 5: hides
Inf: stays
HTML is trusted as it is. Plain text is escaped and always safe. Wrap only your own content in HTML(), never untrusted visitor input. Bootstrap classes such as badge, table, and progress work inside the bubble because bslib includes Bootstrap.
Supply text when setting options. Setting
duration or closable requires
text. To remove the bubble, pass
bubble = mascot_bubble() to
update_mascot().
Hide the space kept for the bubble. An inline mascot
keeps room above it for a bubble, even when none shows. On a page that
never shows a bubble, add
.mascot-bubble-region { display: none; } to your CSS. See
?mascot_styling for the classes you can style.
Warnings, errors and common mistakes
mascot_bubble("Hi", duration = 0)
