Skills

Shiny for R Apps

Builds, styles, tests and debugs Shiny for R apps with reactivity and bslib layouts.

Install

npx skills add rstudio/shiny --skill shiny-for-r -g -a claude-code -y
Repository
rstudio/shiny5.7k
Category
Engineering
Updated
6d ago
License
MIT
Context cost
Lightabout 1,246 tokens
Runs scripts
No, instructions only

What it does

Building, styling, testing, debugging, or observing a Shiny for R app - library(shiny), shinyApp(), runApp(). Index skill: read this, then open the linked reference for the task. Covers reactivity (reactive/observe/req/isolate/bindEvent); modules; async promises and ExtendedTask; bslib layouts, navigation, cards, value boxes, and theming (incl. thematic and brand.yml); dynamic UI; plots with click/brush interaction; tables, file upload/download; notifications, modals, progress, validation; bookmarking; custom JS components; testServer testing; debugging; OpenTelemetry; and when to reach for DT, plotly, leaflet, shinychat, or shinytest2. Use when writing or changing any Shiny for R app, especially a dashboard, or when tempted to hand-roll what the framework provides - custom HTML tables, fake tabs, polling loops, blocking reactive work, or print-debugging server state.

Shiny for R

A Shiny app has a ui object (or function), a server(input, output, session) function, and shinyApp(ui, server) to run them together. The reactive graph is the engine: reading a reactive source (input$x, a reactive(), a reactiveVal()) inside a reactive context registers a dependency, so changing that source re-runs everything that read it, you never call outputs or schedule updates yourself.

This skill is an index. Find your task below and read the linked reference file before writing code for that area. Read the one or two references your task actually touches, not all of them.

Not every corner of Shiny has a reference here, plain inputs (selectInput(), actionButton(), ...), deployment, and app performance tuning are not covered. For those, work from your own knowledge of the package and its help pages.

Foundations

TopicUse whenReference
ReactivityA value should recompute or an output update as inputs change; choosing between reactive()/observe()/observeEvent(); req(), isolate(), bindEvent(), timers, pollingreferences/reactivity.md
ModulesA reusable, repeatable UI+server component; avoiding input/output id collisions across copiesreferences/modules.md
Session lifecyclePer-session cleanup (onSessionEnded()), flush hooks, unhandled errors, per-session vs app-level scope, session$userDatareferences/session-lifecycle.md

Async

TopicUse whenReference
AsyncReturning a promises::promise from a render/observer so R keeps serving other sessions during slow I/Oreferences/async.md
Extended tasksRunning slow work in a background process while the session that started it stays fully interactive; task buttonsreferences/extended-tasks.md

Dashboard building

Read the whole SKILL.md on GitHub

More in Engineering