shiny.ui.row#

shiny.ui.row(*args, **kwargs)#

Responsive row-column based layout

Layout UI components using Bootstrap’s grid layout system. Use row() to group elements that should appear on the same line (if the browser has adequate width) and column() to define how much horizontal space within a 12-unit wide grid each on of these elements should occupy. See the layout guide for more context and examples.

Parameters
  • args (Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[Union[Tagifiable, Tag, MetadataNode, str, TagList, float, None, Dict[str, Union[str, float, bool, None]], Sequence[ForwardRef]]]]) – Any number of child elements

  • kwargs (Union[str, float, bool, None]) – Attributes to place on the row tag

Return type

A UI element

See also

column()

Example

#| 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.row(
        ui.column(4, ui.input_slider("n", "N", min=0, max=100, value=20)),
        ui.column(8, ui.output_plot("plot")),
    )
)

def server(input: Inputs, output: Outputs, session: Session):
    @output
    @render.plot(alt="A histogram")
    def plot() -> object:
        np.random.seed(19680801)
        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)