1---2name: shiny-for-python3description: Building, styling, testing, debugging, or observing a Shiny for Python (py-shiny) reactive web app - `from shiny import ...`, `shiny run app.py`. Index skill: read this, then open the linked reference for the task. Covers dashboard design and visual QA; card toolbars and accessible icons; interactive Plotly charts and maps; reactivity (calc/effect/value/event/req/isolate); Express vs Core; modules; layout, navigation, dynamic UI, and theming; plots, data frames, files, and custom renderers; LLM chat and Markdown streaming; notifications, modals, progress, and background tasks; bookmarking; custom JS components; session lifecycle; Playwright testing; debugging; and OpenTelemetry. Use when writing or changing any Shiny for Python app, especially an analytical dashboard, or when tempted to hand-roll what the framework provides - custom HTML tables, fake tabs, DOM manipulation, blocking reactive work, polling loops, or print-debugging server state.4---56# Shiny for Python78Shiny for Python (py-shiny) builds reactive web apps in pure Python. Two modes:9**Core** (an explicit `app_ui` object plus a `server(input, output, session)`10function) and **Express** (top-level code in the app file *is* the UI, with11outputs defined inline). The reactive graph is the engine: reading a reactive12source (`input.x()`, a `reactive.value`, a `@reactive.calc`) inside a reactive13context registers a dependency, so changing that source re-runs everything that14read it — you never call outputs or schedule updates yourself.1516This skill is an **index**. Find your task below and **read the linked17reference file before writing code** for that area.1819## Foundations2021| Topic | Use when | Reference |22|---|---|---|23| Reactivity | A value should recompute or an output update as inputs change; choosing between calc / effect / value; `req`, `isolate`, timers, polling | `references/reactivity.md` |24| Express mode | Writing or converting an Express app (`from shiny.express import ...`); context-manager layout; `page_opts`, `@expressify` | `references/express.md` |25| Modules (Core) | A reusable, repeatable UI+server component in a Core app; avoiding input/output id collisions across copies | `references/modules-core.md` |26| Modules (Express) | The same reusable-component need in an Express app, via the single `@module` decorator | `references/modules-express.md` |27| Session lifecycle | Per-session cleanup (`on_ended`), reading request headers/cookies/URL, flush hooks, per-session routes | `references/session-lifecycle.md` |2829## Dashboard building3031| Topic | Use when | Reference |32|---|---|---|33| Dashboard design | Turning a dataset or brief into a polished analytical dashboard; planning information hierarchy, shared filters, responsive layout, empty states, and the final visual/functional quality pass | `references/dashboard-design.md` |34| Dashboard components | Composing cards, KPI value boxes, local card toolbars, accessible icons, tooltips, and popovers | `references/dashboard-components.md` |35| Interactive charts | Rendering Plotly charts with shinywidgets; choosing chart forms, applying a coherent visual system, formatting hover/data labels, and handling empty data | `references/interactive-charts.md` |36| Maps | Choosing and rendering a geographic widget; cleaning coordinates, avoiding overplotting, and selecting Plotly, ipyleaflet, or lonboard by interaction and scale | `references/maps.md` |3738## Layout & navigation3940| Topic | Use when | Reference |41|---|---|---|42| Layouts | Arranging a page into cards, columns, sidebars, value boxes, or accordions (bslib containers) | `references/layouts.md` |43| Navigation | Tabs, pills, or a navbar with multiple pages; reading/switching the active tab; runtime nav panels | `references/navigation.md` |44| Dynamic UI | UI that changes after render — `@render.ui`, `ui.update_*`, `insert_ui`/`remove_ui`, `panel_conditional` | `references/dynamic-ui.md` |45| Theming | Colors, fonts, Bootswatch presets, Sass variables, brand.yml, light/dark mode via `ui.Theme` | `references/theming.md` |4647## Outputs & rendering4849| Topic | Use when | Reference |50|---|---|---|51| Static plots & images | Rendering matplotlib/seaborn/plotnine figures or images; static plot click/hover/brush interactions. For Plotly, read Interactive charts above | `references/plots.md` |52| Data frames | Interactive tables via `@render.data_frame` (DataGrid/DataTable) — sort, filter, select, edit | `references/data-frames.md` |53| Files | File uploads (`ui.input_file`) and generated-file downloads (`@render.download_button`/`@render.download_link`) | `references/files.md` |5455## Feedback & interactivity5657| Topic | Use when | Reference |58|---|---|---|59| Feedback | Toasts/notifications, modal dialogs, progress bars, busy indicators | `references/feedback.md` |60| Extended tasks | Running slow work off the reactive flush without freezing the app; task buttons | `references/extended-tasks.md` |61| Bookmarking | Saving/restoring app state — shareable URLs, refresh persistence, server-side state | `references/bookmarking.md` |6263## AI & streaming6465| Topic | Use when | Reference |66|---|---|---|67| Chat | Building an LLM chatbot with `ui.Chat` — streaming responses, wiring a provider, chat history | `references/chat.md` |68| Markdown streaming | Streaming Markdown/LLM text into a non-chat region with `ui.MarkdownStream` | `references/markdown-streaming.md` |6970## Extending Shiny7172| Topic | Use when | Reference |73|---|---|---|74| Custom renderers | Authoring a reusable `@render.xxx` decorator by subclassing `shiny.render.renderer.Renderer` | `references/custom-renderers.md` |75| Custom components | Integrating custom browser JS — custom input/output bindings, `send_custom_message`, HTMLDependency assets | `references/custom-components.md` |7677## Testing & observability7879| Topic | Use when | Reference |80|---|---|---|81| Testing | End-to-end Playwright tests — launching an app under pytest, locating and asserting on UI | `references/testing.md` |82| Debugging | Inspecting server-side reactive/input/output state; exposing values to a test harness | `references/debugging.md` |83| OpenTelemetry | OTel tracing/profiling of reactive execution; exporting spans to a backend | `references/otel.md` |