Creates an EmptyStateManager to then show or hide content.
ValueEmptyStateManager R6 class
DetailsCreates an object to show an empty state content on selected id specified by id
parameter. Then show
or hide
or use is_empty_state_show
to check the status.
new()
Creates a new empty state manager object.
Argumentsid
id of element which should be covered with html_content
html_content
Content for empty state. Defaults to default_empty_state_component()
color
Background color of empty state content. Defaults to NULL
A new EmptyStateManager
R6 class object.
is_empty_state_show()
Returns the current visibility state of the empty state UI. Defaults to FALSE
EmptyStateManager$is_empty_state_show()
Returns
boolean, TRUE
/FALSE
show()
Show empty state component.
ReturnsNothing, it changes state of empty state
Methodhide()
Hides empty state component.
ReturnsNothing, it changes state of empty state
Methodclone()
The objects of this class are cloneable with this method.
UsageEmptyStateManager$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
library(shiny)
library(shiny.emptystate)
library(fontawesome)
ui <- fluidPage(
use_empty_state(),
actionButton("show", "Show empty state!"),
actionButton("hide", "Hide empty state!"),
tableOutput("my_table")
)
server <- function(input, output) {
# Creating a custom empty state component
empty_state_content <- empty_state_component(
content = fa("eye-slash", height = "10rem", fill = "#808000"),
title = "Hide empty state to see table",
subtitle = "This empty state uses a FontAwesome icon."
)
# Initialize a new empty state manager object
manager_object <- EmptyStateManager$new(
id = "my_table",
html_content = empty_state_content
)
observeEvent(input$show, {
# Show empty state
manager_object$show()
})
observeEvent(input$hide, {
# Hide empty state
manager_object$hide()
})
output$my_table <- renderTable(mtcars)
}
if (interactive()) {
shinyApp(ui = ui, server = server)
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4