r/rstats • u/Ok_Mortgage1263 • 3d ago
mascot 0.1.0 on CRAN: animated characters for Shiny apps and Quarto pages
mascot 0.1.0 is now on CRAN. It puts a small character, drawn in code, into your Shiny app. You set its mood and status from the server, and it gives a short wiggle when the state changes.
For Shiny specifically:
# UI
mascot("helper", mood = "idle", status = "Ready when you are", placement = "inline")
# server, when the state changes
update_mascot("helper", mood = "worried", status = "Two dates need a look")- Works inside modules, golem and rhino-style apps (`mascot_examples()` has one of each, plus a form check and a long task)
- `update_mascot()` also shows a speech bubble or plays a nod or wave
- `mascot_popup_menu()` makes the mascot a button with a menu; the choice comes back as `input$<id>_menu`, and it works with the keyboard and screen readers
- Floating in a corner (minimisable) or inline in the page
- Follows your `bslib` theme or your own brand colours, light and dark mode
- Everything ships with the package, no CDN, so it works offline; reduced motion is honoured
- `mascot::mascot_studio()` lets you try every argument and copy the code
Install: `install.packages("mascot")`
Docs: https://insightsurge.github.io/mascot/
Source: https://github.com/insightsurge/mascot
Some parts are experimental in 0.1.0 (Knurl, Neer, the studio, custom character files). I'd like to hear how it fits into your apps and what's missing.
