Skip to content

Skeleton

A grey shape that pulses while content loads, in place of the text or picture that will be there. The pulse stops while it is hidden and when it is destroyed.

Skeleton exampleSkeleton example
Lucy.Panel.new({
    size = UDim2.fromOffset(392, 0),
    children = {
        Lucy.Skeleton.new({ size = UDim2.fromOffset(360, 120) }),
        Lucy.Skeleton.new({ size = UDim2.fromOffset(240, 16) }),
        Lucy.Skeleton.new({ size = UDim2.fromOffset(150, 12) }),
    },
    Parent = parent,
})

Props

PropTypeDefaultState keyWhat it does
visiblebooleantrueyesShows or hides it
sizeUDim2full width, 16 px tallIts size
circlebooleanfalseMakes it round, for avatars

It also takes the props every component takes.

Examples

A placeholder card for a Crew member:

Skeleton exampleSkeleton example
Lucy.Panel.new({
    size = UDim2.fromOffset(220, 0),
    children = {
        Lucy.Skeleton.new({ size = UDim2.fromOffset(48, 48), circle = true }),
        Lucy.Skeleton.new({ size = UDim2.fromOffset(160, 16) }),
        Lucy.Skeleton.new({ size = UDim2.fromOffset(100, 12) }),
    },
    Parent = crewCard,
})

Show it until data arrives:

local loading = Lucy.ref(true)

Lucy.Skeleton.new({ visible = loading, Parent = topDancers })

task.spawn(function()
    loadTopDancers()
    loading(false)
end)

Preview

In Studio, from the command bar: Lucy.Preview.show("Skeleton").