Skip to content
Nana UI

Skeleton

View .md Download

A placeholder that mimics the shape of content while it loads. Supports text lines, circles (avatars), and rectangles (images/cards) with shimmer, pulse, or wave animations. When loading becomes false the skeleton fades out smoothly.

Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/skeleton";
<nana-skeleton style="width:220px;height:1rem"></nana-skeleton>

Use count to render several placeholder lines.

Properties

PropertyAttributeTypeDefaultDescription
animationSkeletonAnimation'shimmer'Animation style — shimmer, pulse, wave, or none
countnumber1Number of skeleton items to render
loadingbooleantrueWhen false the skeleton fades out and slotted content is visible
shapeSkeletonShape'text'Shape of the skeleton placeholder
sizeSkeletonSize'md'Relative size

Slots

SlotDescription
(default)Optional content revealed when loading completes

CSS parts

PartDescription
::part(base)Each skeleton item
::part(wrapper)The container wrapping all items (when count > 1)

CSS custom properties

PropertyDescription
--nana-skeleton-radiusCorner radius override
--nana-skeleton-heightHeight override
--nana-skeleton-widthWidth override
--nana-skeleton-gapGap between items when count > 1
--nana-skeleton-fade-durationFade-out transition duration (default 200ms)
SlotDescription
(default)Optional content revealed when loading completes
VariableDefaultDescription
--nana-skeleton-radiusCorner radius override
--nana-skeleton-heightHeight override
--nana-skeleton-widthWidth override
--nana-skeleton-gapGap between items when count > 1
--nana-skeleton-fade-durationFade-out transition duration (default 200ms)
PartDescription
baseEach skeleton item
wrapperThe container wrapping all items (when count > 1)
Explore Skeleton interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook