Skip to contents

Each skeleton below is drawn by bones_skeleton() on this page. In an app, withBones() draws the same shape around an output.

Text, cards and values

textOutput() and uiOutput() get the text shape. Use "cards" and "value" for a uiOutput() that holds cards or value boxes.

type = "text"
type = "cards"
type = "value"

Charts

A plotOutput() gets the bar shape. It cannot say what kind of chart it will hold, because renderPlot() decides that later, on the server. So give the kind with type: withBones(plotOutput("p"), type = "scatter").

type = "plot"
type = "bar"
type = "line"
type = "area"
type = "scatter"
type = "histogram"
type = "pie"
type = "heatmap"

Maps, networks, timelines and word clouds

These shapes are also for widgets. bones finds them from the output: a leaflet::leafletOutput() gets the map, a visNetwork::visNetworkOutput() gets the network, and so on. Give type = "map" to a map that draws into a plotOutput(), such as one from ggmap.

type = "map"
type = "network"
type = "timeline"
type = "wordcloud"

plotly, echarts4r and highcharter

A plotly::plotlyOutput(), echarts4r::echarts4rOutput() or highcharter::highchartOutput() can hold any kind of chart, so its first skeleton has the bar shape. When its first value arrives, bones reads the kind of the chart from its series, and the next loads show that shape: bar, line, area, scatter, histogram, pie, heatmap, map, network or word cloud. A kind with no shape, such as a box plot, keeps the bar shape. bones stores the kind in the browser too, so on the next visit the first skeleton has the right shape. Set remember = FALSE to store nothing, or give type to choose the shape yourself.

Tables

A tableOutput() gets the plain table shape. A table from a table package gets a shape that copies that package, and bones finds the package from the output, with no type. Set rows to the number of rows on a page.

type = "table"
type = "dt"
type = "reactable"
type = "gt"
type = "rhandsontable"