Skeleton
skeleton · Elements
The shape of content that has not arrived, in place of it.
Import
cpp
#include "gbui/widgets/skeleton.hpp"Example
cpp
NodeId skeleton(Ui& ui, const SkeletonOptions& options = {});A placeholder in the shape of what is coming.
API
SkeletonOptions
| Option | Type | Default | What it does |
|---|---|---|---|
shape | SkeletonShapeText · Block · Circle | SkeletonShape::Text | What it is standing in for: a line, a block, or an avatar. |
width | float | kAuto | |
height | float | 0.0f | |
grow | float | 0.0f | |
radius | float | 0.0f | |
phase | float | 0.0f | Where in its sweep the shimmer is, in turns. Feed it a clock. The caller's, like spinner's and progressBar's: a component here holds no state. Leave it at zero for a still placeholder, which is the honest choice when several are on screen — a dozen shimmers out of step with each other is a page that looks broken rather than busy. |
name | std::string_view | What is loading, announced once for the group. Put it on the first skeleton of a set and leave the rest silent. A reader told "loading" six times has been told nothing six times, which is why every one of these is hidden from the tree unless it is named. |