shiny.ui.page_fluid(*args, title=None, lang=None, **kwargs)#

Create a fluid page.

  • args (Any) – UI elements.

  • title (Optional[str]) – The browser window title (defaults to the host URL of the page). Can also be set as a side effect via panel_title().

  • lang (Optional[str]) – ISO 639-1 language code for the HTML page, such as "en" or "ko". This will be used as the lang in the <html> tag, as in <html lang="en">. The default, None, results in an empty string.

  • kwargs (str) – Attributes on the page level container.

Return type

A UI element.


#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
from shiny import *
import matplotlib.pyplot as plt
import numpy as np

app_ui = ui.page_fluid(
        ui.panel_sidebar(ui.input_slider("n", "N", min=0, max=100, value=20)),

def server(input: Inputs, output: Outputs, session: Session):
    @render.plot(alt="A histogram")
    def plot() -> object:
        x = 100 + 15 * np.random.randn(437)

        fig, ax = plt.subplots()
        ax.hist(x, input.n(), density=True)
        return fig

app = App(app_ui, server)