ui.row
*args, **kwargs) ui.row(
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. (The article is about Shiny for R, but the general principles are the same.)
Parameters
*args : TagChild | TagAttrs = ()
-
Any number of child elements.
****kwargs** : TagAttrValue = {}
-
Attributes to place on the row tag.
Returns
: Tag
-
A UI element.
See Also
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
import matplotlib.pyplot as plt
import numpy as np
from shiny import App, Inputs, Outputs, Session, render, ui
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):
@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)