Read page as text

NIB / DOCUMENTATION

Skeleton — NibComponents

Turn one authored content tree into a loading placeholder, then reveal that same content.

Open interactive view

Author the content once

NibSkeleton takes loading and the real child tree. While loading, the package converts supported nodes to bone shapes; otherwise it shows the content. Press Reveal content to switch the real loading property and inspect the result. The local example does not fetch data.

Automatic detection works best with the supported layout and text widgets. A custom StatefulWidget or painter may become a generic fallback box. Check the placeholder instead of assuming every arbitrary subtree can be inferred correctly.

Mark the cases the detector cannot infer

NibSkeletonBone provides explicit width, height, and a NibSkeletonShape for custom content. The preview marks the icon area and lets you choose a circle or rectangle. The real child remains the same when loading ends.

NibSkeletonIgnore keeps its child unchanged and prevents the shade traversal from recursing into it. FIELD NOTES stays visible here to demonstrate a stable label. Do not ignore private data just to make a placeholder prettier; decide which content may be visible while loading.

Choose static bones or an animated transition

animated defaults to false and swaps the shaded and real trees immediately. Turning it on adds per-bone shimmer and a NibPresence opacity dissolve. This website starts that opt-in effect, then disables it for reduced motion or a disabled host TickerMode. transition controls the dissolve, while baseColor and shimmerColor customize the palette.

borderRadius affects generic box bones; text-line bones stay fully rounded and circular avatar bones stay circular. fallbackWidth and fallbackHeight size unidentified nodes. boneSpacing adds to existing Row or Column spacing rather than replacing it.

Keep status and interaction outside the placeholder

The loading skeleton ignores pointer input. Keep a readable loading status or host action outside the shaded subtree, as this demo does. Do not make a skeleton the only way to understand why content is unavailable.

Preserve the host data state when changing the palette or motion setting. If loading fails, show the actual error and retry action instead of leaving an infinite placeholder. The preview toggle is a bounded local state exercise.