Skip to content

Built-in Skeleton loading placeholder (<StxSkeleton>) #1681

@glennmichael123

Description

@glennmichael123

Summary

Animated loading placeholders that match content layout — for perceived performance during data fetching.

Usage

<!-- Basic shapes -->
<StxSkeleton width="200px" height="1rem" />
<StxSkeleton variant="circle" size="48px" />
<StxSkeleton variant="rect" width="100%" height="200px" radius="lg" />

<!-- Preset patterns -->
<StxSkeleton preset="card" />
<StxSkeleton preset="list-item" count="5" />
<StxSkeleton preset="avatar-text" />
<StxSkeleton preset="table" rows="5" cols="4" />

<!-- Conditional with loading state -->
<div :if="loading()">
  <StxSkeleton preset="card" count="3" />
</div>
<div :if="!loading()">
  <!-- real content -->
</div>

Props

  • variant: text | circle | rect (default: text)
  • preset: card | list-item | avatar-text | table | paragraph
  • width, height, size (for circle)
  • count — repeat the skeleton N times
  • radius — border radius (sm/md/lg/full)
  • animatepulse (default) | wave | none

Implementation

  • Pure CSS animation (pulse or shimmer wave)
  • No JS runtime needed — fully static builtin
  • Dark mode aware (lighter base in dark mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions