Getting rid of the renderUI
Customize the previously designed
box()
function to gather as many parameters as possible.width
should be numerictitle
might be any HTML tag or a list of HTML tags
Omit any
NULL
parameter from theprops
list.
box2 <- function(..., id = NULL, title = NULL, footer = NULL,
background = NULL, width = 6, height = NULL,
collapsible = FALSE, collapsed = FALSE) {
if (!is.null(title)) {
processed_title <- if (
inherits(title, "shiny.tag.list") ||
inherits(title, "shiny.tag")
) {
as.character(title)
} else {
title
}
}
# We don’t want to send empty arrays
props <- dropNulls(
list(
title = processed_title,
background = background,
width = width
)
)
# ....; Extra code removed
}