Skip to content

Skeleton

Grey shapes that pulse where text, pictures or rows will appear, so the layout does not jump when they arrive. lines makes a paragraph and circle an avatar.

ui.skeleton · Category: Feedback · Full reference →

SkeletonSkeleton
  • While a list, a profile or a card is loading.
  • For a short wait with no known shape, a Spinner is enough.
import pyzed as pz
from pyzed import ui
pz.container(pz.row([
ui.skeleton(height=40, circle=True),
pz.column([ui.skeleton(width=160, height=14), ui.skeleton(lines=2, height=10)], spacing=10, width="fill"),
], spacing=12), width=360)
Skeleton: A barSkeleton: A bar
A bar
Code
pz.container(ui.skeleton(height=14), width=320)
Skeleton: lines=3Skeleton: lines=3
lines=3
Code
pz.container(ui.skeleton(lines=3, height=10), width=320)
Skeleton: circle=TrueSkeleton: circle=True
circle=True
Code
ui.skeleton(height=48, circle=True)
Skeleton: A cardSkeleton: A card
A card
Code
pz.container(pz.column([ui.skeleton(height=120, radius=8), ui.skeleton(width=180, height=14), ui.skeleton(lines=2, height=10)], spacing=10), width=280)
Skeleton: animated=FalseSkeleton: animated=False
animated=False
Code
pz.container(ui.skeleton(lines=2, animated=False), width=320)

Skeleton has no events of its own: it shows what you give it. Like every widget it also has the 18 common events (click, double_click, right_click, mouse_enter, drag, key_down, resize…), attached with .on(...): see Events and Events of every component.

skeleton(
width='fill',
height=12,
*,
lines=1,
circle=False,
radius=None,
spacing=8,
animated=True,
theme=None,
)

A grey placeholder that pulses where content is still loading. lines makes a paragraph and circle an avatar.

Property Default Description
width "fill" Width: pixels, "fill", "shrink" or "fill:N" (proportion).
height 12 Height of each bar (the diameter with circle).
lines 1 Stacks several bars, the last one shorter.
circle False A round placeholder of height.
radius None Corner radius: a number or (top_left, top_right, bottom_right, bottom_left).
spacing 8 Space between children, in pixels.
animated True Pulses (it stays still when the system asks for reduced motion).
theme None Theme to use instead of the current one (pyzed.theme.current()).

Full reference →