What is Shiny?

Whether you’re a data scientist, analyst, or developer, Shiny makes it easy to create rich, interactive experiences in pure Python with a fully reactive framework. No need to learn JavaScript or front-end frameworks.

Batteries included

Shiny for Python comes fully equipped with everything you need to build a dashboard right out of the box, including a rich set of input and output components. There is an entire components gallery to help you quickly build interactive applications.

Layout options let you organize your UI efficiently, while built-in theming (including dark mode) ensures your app looks great with minimal effort.

Already have a brand guideline? You can use brand.yml to apply consistent branding, colors, and logos across your application.

Reactivity

At the heart of Shiny is reactivity, a system that automatically updates outputs when inputs change for seamless interactivity, without manually writing callbacks.

Shiny’s reactive engine avoids unnecessary computations by only re-calculating the outputs whose inputs have changed, making Shiny ideal for fast data-driven applications, enabling live updates for charts, tables, and reports with minimal effort.

Below is a live Shiny application and its accompanying code. The first output text shows the square of the first slider value, and the second row of text shows the sum of both slider values.

Try updating the sliders below and see how the text reacts. Also change what value gets returned on lines 11 or 17 and click the play button ▶️ for the app to refresh.

#| '!! shinylive warning !!': |
#|   shinylive does not work in self-contained HTML documents.
#|   Please set `embed-resources: false` in your metadata.
# | standalone: true
# | components: [editor, viewer]
# | layout: vertical
# | viewerHeight: 250

from shiny import reactive
from shiny.express import ui, render, input

ui.input_slider("s1", "Slider 1", min=0, max=10, value=5)
ui.input_slider("s2", "Slider 2", min=0, max=100, value=50)


# This output only reacts to the first slider
@render.text
def result():
    return f"{input.s1()} squared is {input.s1() ** 2}."


# This output reacts to both sliders
@render.text
def both_sliders_output():
    return f"{input.s1()} + {input.s2()} is {input.s1() + input.s2()}."

Jumpstart with templates

Here’s a full Shiny application in action, complete with reactivity and a user interface!

Hit the ground running with one of our starter templates, like the app above, by using shiny create.

There are templates for common use cases. For example, data dashboards, data applications, streaming updates, or data entry.

Use the terminal command below to create and run the same dashboard locally with shiny create, starting from a template.

shiny create --template dashboard

Extensibility

While Shiny includes everything you need to build an app, it is also built on a foundation of web standards, making it highly extensible. Many of Shiny’s components are just plain HTML elements with the right classes to connect to Shiny’s client-side JavaScript.

Take the action button, for example. You can print the input in the Python console to see that it’s just a regular HTML <button> element.

>>> from shiny import ui
>>> ui.input_action_button("update_data", "Button")
<button class="btn btn-default action-button" id="update_data" type="button">Button</button>

This means that you can use Shiny to learn web development—and many people have!

But this also means that Shiny doesn’t lock you into a particular front-end framework. At the more advanced end of the spectrum, Shiny components can be highly sophisticated and can leverage modern web frameworks. For example, Data Grids are React components that use the popular TanStack Table React library under the hood.

If you’re versed in web programming, you can use Shiny to build one-off custom components that integrate your favorite JavaScript framework directly from Python. For more advanced needs, you can develop a reusable component package or customize the user interface by incrementally adding JavaScript or custom HTML or CSS.

Install, create, and run

Now that you know a little more about Shiny for Python, let’s go install Shiny so you can create your first application!