Skip to contents

Function to create a custom empty state component.

Usage

empty_state_component(content, title, subtitle = NULL)

Arguments

content

An HTML tag object used to render and provide the main content for the empty state.

title

A character string representing the main text that describes the empty state content.

subtitle

A character string providing supporting details about the empty state. Defaults to NULL

Value

a shiny.tag

Details

content works best with fontawesome::fa() and bsicons::bs_icon(). shiny::icon() will also work, but this will require loading the html dependencies in the ui, i.e. calling fontawesome::fa_html_dependency() to use icons from FontAwesome.Glyphicon does not need any html dependency.

Examples

library(shiny.emptystate)

if (interactive()) {
  empty_state_component(
    fontawesome::fa(name = "clipboard-question", height = "10rem"),
    title = "Content is not available",
    subtitle = "Please provide valid inputs to generate content."
  )

  empty_state_component(
    bsicons::bs_icon(
      name = "question-square",
      size = "15rem"
    ),
    title = "Content is not available",
    subtitle = "Please provide valid inputs to generate content."
  )
}