| bones_auto | R Documentation |
Gives skeletons to an app with no change to each output. bones_auto()
looks through a UI and puts each Shiny output in withBones(). Each one
gets the shape of its output, as with withBones(output): a
plotOutput() gets a chart, a tableOutput() gets rows, a DT table
gets the shape of DT, and so on.
bones_auto(ui, ..., exclude = NULL)
ui |
A UI: a page, a tag, or a tag list. |
... |
Arguments for |
exclude |
The ids of outputs to leave alone. |
Give it the whole page, or only a part of it:
ui <- bones_auto(page_sidebar(...)) ui <- page_sidebar(sidebar = ..., bones_auto(navset_card_tab(...)))
ui, with each output in a placeholder container. A page keeps
its class and its theme.
An output that is already in withBones(). To give one output its own
shape or options, wrap it yourself: bones_auto() keeps that wrapper.
An output whose id is in exclude.
An inline output, such as textOutput("n", inline = TRUE). The
wrapper is a block, so it would break the line of text.
A uiOutput() can hold anything, so it gets the text shape. Wrap it
yourself to give it another shape, such as type = "cards".
bones_auto() sees only the UI that you give it. Outputs that a
renderUI() makes later are not in it. Call bones_auto() on the UI
inside that renderUI() to give them skeletons too.
if (requireNamespace("shiny", quietly = TRUE)) {
library(shiny)
ui <- bones_auto(fluidPage(
plotOutput("chart"),
tableOutput("results"),
textOutput("count", inline = TRUE), # inline: left alone
withBones(uiOutput("cards"), type = "cards") # wrapped already: kept
))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.