standard_layout: Standard UI layout

View source: R/standard_layout.R

standard_layoutR Documentation

Standard UI layout

Description

[Stable]
Create a standard UI layout with output on the right and an encoding panel on the left. This is the layout used by the teal modules.

Usage

standard_layout(
  output,
  encoding = NULL,
  forms = NULL,
  pre_output = NULL,
  post_output = NULL
)

Arguments

output

(shiny.tag)
object with the output element (table, plot, listing) such as for example returned by shiny::plotOutput().

encoding

(shiny.tag)
object containing the encoding elements. If this element is NULL then no encoding side panel on the right is created.

forms

(tagList)
for example shiny::actionButton() that are placed below the encodings panel

pre_output

(shiny.tag) optional,
with text placed before the output to put the output into context. For example a title.

post_output

(shiny.tag) optional, with text placed after the output to put the output into context. For example the shiny::helpText() elements are useful.

Value

an object of class shiny.tag with the UI code.

Examples

library(shiny)
standard_layout(
  output = white_small_well(tags$h3("Tests")),
  encoding = tags$div(
    tags$label("Encodings", class = "text-primary"),
    panel_item(
      "Tests",
      optionalSelectInput(
        "tests",
        "Tests:",
        choices = c(
          "Shapiro-Wilk",
          "Kolmogorov-Smirnov (one-sample)"
        ),
        selected = "Shapiro-Wilk"
      )
    )
  ),
  forms = tagList(
    verbatim_popup_ui("warning", "Show Warnings"),
    verbatim_popup_ui("rcode", "Show R code")
  )
)


teal.widgets documentation built on April 4, 2025, 2:17 a.m.