Learn R Programming

dash (version 0.9.4)

set_layout: 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

Run this code
# NOT RUN {
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()) })
# }

Run the code above in your browser using DataLab