express.render.express
express.render.express(self,
=None,
_fn*,
=False,
inline=None,
container=False,
fill=False,
fillable**kwargs,
)
Reactively render HTML content with output captured as in Shiny Express
This is similar to ui, except that ui uses the return value from the the decorated function, whereas this function works like Shiny Express: as it executes each line of the decorated function, it calls :func:~sys.displayhook()
on the result. This has the effect of "capturing" the output of each line.
This decorator can be thought of as a combination of ui (for rendering and sending the dynamic UI to the client), and ~shiny.express.expressify
(for capturing the output of each line).
Returns
:
-
A decorator for a function that returns
None
.
See Also
ui
output_ui
- expressify
- hold
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny.express import input, render, ui
ui.input_text("name", "Name", "Socrates")
ui.input_text("years", "Years", "470-399 BC")
@render.express
def person():
with ui.card(class_="mt-3"):
ui.h3(input.name())
input.years()