# Shiny for R Apps

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

- Repository: https://github.com/rstudio/shiny (5707 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add rstudio/shiny --skill shiny-for-r -g -a claude-code -y`
Codex: `npx skills add rstudio/shiny --skill shiny-for-r -g -a codex -y`
Cursor: `npx skills add rstudio/shiny --skill shiny-for-r -g -a cursor -y`
Gemini CLI: `npx skills add rstudio/shiny --skill shiny-for-r -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

| Topic | Use when | Reference |
|---|---|---|
| Reactivity | A value should recompute or an output update as inputs change; choosing between `reactive()`/`observe()`/`observeEvent()`; `req()`, `isolate()`, `bindEvent()`, timers, polling | `references/reactivity.md` |
| Modules | A reusable, repeatable UI+server component; avoiding input/output id collisions across copies | `references/modules.md` |
| Session lifecycle | Per-session cleanup (`onSessionEnded()`), flush hooks, unhandled errors, per-session vs app-level scope, `session$userData` | `references/session-lifecycle.md` |

## Async

| Topic | Use when | Reference |
|---|---|---|
| Async | Returning a `promises::promise` from a render/observer so R keeps serving other sessions during slow I/O | `references/async.md` |
| Extended tasks | Running slow work in a background process while the session that started it stays fully interactive; task buttons | `references/extended-tasks.md` |

## Dashboard building

The rest: https://github.com/rstudio/shiny/blob/HEAD/inst/skills/shiny-for-r/SKILL.md
