shiny-for-python

Guides building, styling, testing, and debugging Shiny for Python reactive web applications.

1.8k|134|Updated Jul 27, 2021
One-click install
npx skills add https://github.com/posit-dev/py-shiny --skill shiny-for-python
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shiny-for-python
Source: https://github.com/posit-dev/py-shiny/tree/main/shiny/.agents/skills/shiny-for-python
Command: npx skills add https://github.com/posit-dev/py-shiny --skill shiny-for-python

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Writing Shiny for Python apps requires knowing the right reactive patterns, layout primitives, and rendering APIs; this Skill routes an AI agent to the correct reference documentation before it writes code, preventing hand-rolled workarounds like custom HTML tables, fake tabs, DOM manipulation, and blocking reactive work.

Core Features & Use Cases

  • Index of 20+ topic references: Covers reactivity (calc/effect/value/event/req/isolate), Express vs Core modes, modules, layouts, navigation, dynamic UI, theming, plots, data frames, files, chat, bookmarking, custom components, Playwright testing, debugging, and OpenTelemetry.
  • Dashboard workflow guidance: References for dashboard design, card toolbars, value boxes, accessible icons, interactive Plotly charts, and maps with visual QA checklists.
  • Use Case: Ask an agent to build an analytical dashboard with shared filters, KPI value boxes, and a Plotly chart; the agent reads the dashboard-design, layouts, and interactive-charts references and produces idiomatic Shiny code instead of ad-hoc HTML.

Quick Start

Ask the agent to build a Shiny for Python dashboard app with a sidebar filter, value boxes, and an interactive Plotly chart, and it will consult the linked references before writing the code.

Frequently Asked Questions about shiny-for-python

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Shiny for Python dashboard app?

Start with ui.page_sidebar for shared filters, add a row of ui.value_box KPIs, then cards containing charts and a data table. Drive everything from one @reactive.calc that filters the data so all outputs stay consistent.

What is the difference between Shiny Express and Core mode?

Express mode treats top-level code as the UI with context-manager layout and no App() or server() function, while Core uses an explicit app_ui object plus a server(input, output, session) function. A file must use one mode or the other, never both.

How do I run slow computations without freezing a Shiny app?

Decorate an async function with @reactive.extended_task and invoke it from an effect, passing reactive values as arguments since the task cannot read them directly. Read the outcome with task.result() inside a reactive context and pair it with ui.input_task_button.

Can I test Shiny for Python apps with Playwright?

Yes, Shiny ships Playwright fixtures and controller classes for launching an app under pytest and asserting on UI elements. Enable test mode with SHINY_TESTMODE=1 to read input, output, and exported values via controller.AppTestValues.

Why is my Shiny reactive output not updating?

Outputs only re-run when a reactive source they read changes; reading values outside a reactive context or calling ui.update_* at server top level breaks the dependency. Wrap updates in @reactive.effect and guard missing inputs with req().

Does Shiny for Python support LLM chatbots?

Yes, ui.Chat provides a complete chat UI with streaming, markdown rendering, and cancellation. Pass a chatlas client like ChatOpenAI to auto-wire streaming responses and conversation history, or handle @chat.on_user_submit manually.