set_layout: Set the layout of a Dash app

View source: R/wrappers.R

set_layoutR Documentation

Set the layout of a Dash app

Description

Set the layout of a Dash app

Usage

set_layout(app, ...)

Arguments

app

A dash application created with dash_app()

...

Dash components to create the user interface, provided either as comma-separated components or a list of components. You can also provide a function returning a Dash component if you want the layout to re-render on every page load.

Examples

app <- dash_app()

app %>% set_layout("hello", "Dash")
app %>% set_layout(div("hello"), "Dash")
app %>% set_layout(list(div("hello"), "Dash"))
app %>% set_layout("Conditional UI using an if statement: ",
                   if (TRUE) "rendered",
                   if (FALSE) "not rendered")
app %>% set_layout(function() { div("Current time: ", Sys.time()) })

dash documentation built on June 23, 2022, 9:11 a.m.