error_text: error_text

Description Usage Arguments Examples

View source: R/error_text.R

Description

Create a text element for displaying inline or text only error messages. By default, this creates an empty element that is hidden by default.

Usage

1
error_text(inputId, class = NULL)

Arguments

inputId

a ID for the error message element

class

optional CSS classes to include

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if (interactive()) {
  library(shiny)

  ui <- tagList(
    iceComponents::use_iceComponents(),
    iceComponents::container(
      iceComponents::page(
        tags$h2("My App"),
        tags$p("Please wait while the app loads..."),
        iceComponents::error_text(
          inputId = "shiny-server-error"
        )
      )
    )
  )

  server <- function() {
    err <- function() {
       Sys.sleep(2)
       iceComponents::show_error_text(
         inputId = "shiny-server-error",
         error = "Internal Server Error (500)"
       )
    }

    err()

  }

  shinyApp(ui, server)

}

InControlofEffects/iceComponents documentation built on April 1, 2021, 5:51 a.m.