DesignOverviewDesign SystemMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingAgentsCortexMemoryActiveProvenanceActiveContextActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
SkeletonView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorA placeholder shown in place of content that is still loading.Also called Placeholder, Shimmer, and Ghost.StableSince 0.1.0FeedbackImportimport'@fusion.dev/helix/skeleton'import'@fusion.dev/helix-headless/skeleton'Preview
GuidelinesWhen to use
The shape of content that is loading, where its layout is known.SkeletonThis page
Put the real content inside the skeleton and set loading.The skeleton takes the content's size, so nothing moves when the content arrives.<helix-flexdirection="column"gap="sm"><helix-skeletonloading><helix-buttonemphasis="solid">Save the profile</helix-button></helix-skeleton><helix-skeleton><helix-buttonemphasis="solid">Save the profile</helix-button></helix-skeleton></helix-flex>
Draw your own placeholder in the placeholder slot for content that is not there until it loads.The placeholder shows while loading is set, laid out as the content will be, such as a circle and three lines for a profile.<linkhref="styles.css"rel="stylesheet"/><helix-flexdirection="column"gap="md"><helix-cardseparation="outlined"><helix-skeletonid="profile"label="Loading the profile"loading><helix-flexdirection="column"gap="md"slot="placeholder"><helix-flexalign-items="center"gap="sm"><helix-skeletonshape="circle"></helix-skeleton><helix-flexdirection="column"gap="2xs"><helix-skeletonclass="line-name"shape="text"></helix-skeleton><helix-skeletonclass="line-role"shape="text"></helix-skeleton></helix-flex></helix-flex><helix-skeletonlines="2"shape="text"></helix-skeleton></helix-flex></helix-skeleton></helix-card><helix-textemphasis="muted">Profiles are read from the team directory, which updates every hour.</helix-text><helix-buttonid="reload">Reload the profile</helix-button></helix-flex><scripttype="module">constprofile=document.getElementById('profile')constpeople=[{bio:'Writes the programs that run on the Analytical Engine and keeps the notes the team works from. Ask her about the tables for the Bernoulli numbers.',name:'Ada Lovelace',role:'Analyst, Engines team',},{bio:'Leads the compiler work. Her team turned a page of English into the first program a machine could read, and she still keeps the moth from the logbook on her desk. She answers messages in the morning.',name:'Grace Hopper',role:'Lead engineer, Compilers',},]letnext=0constdetails=(person)=>{constdetails=document.createElement('helix-flex')details.setAttribute('direction','column')details.setAttribute('gap','md')details.innerHTML=` <helix-flex align-items="center" gap="sm"> <helix-avatar></helix-avatar> <helix-flex direction="column"> <helix-text as="h3" scale="title"></helix-text> <helix-text emphasis="muted"></helix-text> </helix-flex> </helix-flex> <helix-text></helix-text>`details.querySelector('helix-avatar').setAttribute('name',person.name)const[name,role,bio]=details.querySelectorAll('helix-text')name.textContent=person.namerole.textContent=person.rolebio.textContent=person.bioreturndetails}// Put the loaded profile in and take `loading` off in the same task. The// skeleton crossfades to the profile while the card grows to fit it.constload=()=>{profile.loading=truesetTimeout(()=>{profile.querySelector(':scope > :not([slot])')?.remove()profile.append(details(people[next%people.length]))next+=1profile.loading=false},1200)}document.getElementById('reload').addEventListener('click',load)load()</script>
Anatomy
1::part(skeleton)The placeholder shape, or each line of a lines paragraph.
API referenceRoothelix-skeletonA placeholder shown in place of content that is still loading.
PropTypeDescriptioneffect"none"|"pulse"How the placeholder shows it is waiting: a sweep when unset, pulse to
fade the fill in and out, or none to sit still.labelstringDefault""What is loading, read out as the placeholder's name, such as "Loading
profile".linesnumberHow many lines of text the placeholder stands for, with shape="text".loadingbooleanDefaultfalseWhether the content inside is still loading, which keeps it inert and
draws the placeholder over it.shape"text"|"circle"The shape of the placeholder: text, circle, or a block when unset.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The content the skeleton stands in for, which sizes it. Optional.placeholderWhat shows while loading is set, in place of the content, such as skeletons laid out as the content will be. Falls back to the skeleton's own shape.
PartDescriptioncontentThe box around the content, hidden while loading.lineEach line of a lines paragraph, which is also a skeleton part.linesThe column holding a lines paragraph, drawn only for shape="text" with two or more lines.pieceEach shape drawn over a wrapped field: its label, its box, and its hint. Also a skeleton part.piecesThe layer holding the shapes drawn over a wrapped field.placeholderThe box around the placeholder slot and the shape it falls back to, which shares the content's place and fades out as the content fades in.sheenThe highlight swept across the shape. Hidden for effect="pulse" and effect="none".skeletonThe placeholder shape, or each line of a lines paragraph.
CSS PropertyDescription--skeleton-block-sizeThe height of the block shape, which is the shape when shape is unset. Defaults to the control height.--skeleton-colorThe placeholder's fill.--skeleton-durationHow long one sweep or one pulse takes.--skeleton-last-line-sizeThe width of the last line of a lines paragraph. Defaults to 60%.--skeleton-radiusThe corner of the block shape. Around content, it defaults to the corner the content draws.--skeleton-reveal-durationHow long the crossfade and the height move take when loading changes. Defaults to --helix-duration-slow. 0ms shows the other side at once.--skeleton-reveal-easingThe curve the crossfade and the height move follow. Defaults to --helix-easing-standard.--skeleton-sheen-colorThe highlight the sweep carries across the fill.--skeleton-sizeThe diameter of the circle shape.
Custom stateDescriptionrevealingThe crossfade and the height move are running, after loading changed.settledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.wrappingThe skeleton holds content, an element or words, and takes that content's size. Line breaks and spaces alone are not content.wrapping-blockThe content the skeleton holds is a block, which fills its line, so the skeleton fills the line with it.
Roothelix-headless-skeletonA placeholder shown in place of content that is still loading.
PropTypeDescriptionlabelstringDefault""What is loading, read out as the placeholder's name, such as "Loading
profile".loadingbooleanDefaultfalseWhether the content inside is still loading, which keeps it inert and
draws the placeholder over it.
ReadTypeDescriptionwhenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The content the skeleton stands in for, which sizes it. Optional.placeholderWhat shows while loading is set, in place of the content, such as skeletons laid out as the content will be. Falls back to the skeleton's own shape.
PartDescriptioncontentThe box around the content, inert while loading, and hidden while loading where the placeholder slot is filled.placeholderThe box around the placeholder slot and the shape it falls back to, hidden once the content has loaded.sheenThe highlight inside the shape, which the styled tier sweeps across it. Empty, and drawn by no rule on this tier.skeletonThe placeholder shape.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.wrappingThe skeleton holds content, an element or words, and takes that content's size. Line breaks and spaces alone are not content.wrapping-blockThe content the skeleton holds is a block, which fills its line, so the skeleton fills the line with it.
Examples
NameDescriptionEffectsThe three effects: the sweep at rest, pulse for a dense list, and none for a placeholder that sits still.LoadingA skeleton around real content takes its size, and shows the content once loading is gone.ParagraphA paragraph of three lines from one element, with lines, the last line shorter.PreviewA circle and two lines of text, shown in place of a profile that is still loading.PreviewA circle and two lines of text, shown in place of a profile that is still loading.RevealingA profile that loads inside its card behind a skeleton laid out as the profile, and crossfades in when it arrives while the card grows to fit it.