Skip to contents

The studio guide for mascot_action(). 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_action")
It opens on this function's guide; change a control and watch the mascot.

From a click to your server

The visitor clicks
Open help
→
input$helper_click
counts up
→
Your observeEvent()
opens your help
→
update_mascot()
can answer too

A picture or a button. Without a click, the mascot is a picture: you cannot tab to it and it sends no events. With one, it is a button named by its label, so screen readers say what a click does.

Supply a label when setting options. Setting tooltip or disabled requires label. To remove the click behaviour, pass click = mascot_action() to update_mascot().

Warnings, errors and common mistakes

mascot_action("Open help", FALSE)
Error: could not find function "mascot_action"