Skip to content

Skeleton

skeleton · Elements

The shape of content that has not arrived, in place of it.

Import

cpp
#include "gbui/widgets/skeleton.hpp"

Example

Nothing is downloaded until you press it.

cpp
NodeId skeleton(Ui& ui, const SkeletonOptions& options = {});

A placeholder in the shape of what is coming.

API

SkeletonOptions

OptionTypeDefaultWhat it does
shapeSkeletonShape
Text · Block · Circle
SkeletonShape::TextWhat it is standing in for: a line, a block, or an avatar.
widthfloatkAuto
heightfloat0.0f
growfloat0.0f
radiusfloat0.0f
phasefloat0.0fWhere 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.
namestd::string_viewWhat 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.

Released under the LGPL-3.0-or-later licence.