Skip to content

Skeleton

Displays a skeleton placeholder while page data is loading, improving user experience. Supports custom rows, row widths, avatar, title, and animation effects.

Platform Compatibility

App(vue)App(nvue)H5Mini Program

Code Examples

Basic Usage

Displays 3 skeleton rows with loading animation by default.

html
<see-skeleton :loading="true">
  <text>Loaded content</text>
</see-skeleton>

Custom Rows

Control the number of skeleton rows via the rows prop.

html
<see-skeleton :rows="5" />

Custom Row Width

Supports a string for uniform width or an array for different widths per row.

html
<!-- Uniform width -->
<see-skeleton row-width="80%" />

<!-- Different width per row -->
<see-skeleton :row-width="['100%', '80%', '60%']" />

Title Mode

When title is enabled, the first row renders with a taller height as a title placeholder.

html
<see-skeleton :title="true" :rows="3" />

Avatar + Title

Supports avatar placeholders that can be combined with title mode.

html
<!-- Circle avatar -->
<see-skeleton :avatar="true" :title="true" :rows="3" />

<!-- Square avatar -->
<see-skeleton :avatar="true" avatar-shape="square" :title="true" :rows="3" />

Disable Animation

Set isAnimate to false to disable the skeleton shimmer animation.

html
<see-skeleton :is-animate="false" />

Loading Complete

Set loading to false to display the actual content slot.

html
<see-skeleton :loading="isLoading">
  <view>
    <text>Actual content</text>
  </view>
</see-skeleton>

API

Props

PropDescriptionTypeDefaultOptions
loadingWhether to show skeleton (loading state)booleantruetrue / false
rowsNumber of skeleton rowsnumber3Positive integer
row-widthWidth of each rowstring | string[]-CSS width value
row-heightRow heightstring'32rpx'CSS height value
row-gapGap between rowsstring'20rpx'CSS spacing value
avatarWhether to show avatar placeholderbooleanfalsetrue / false
avatar-sizeAvatar sizestring'80rpx'CSS size value
avatar-shapeAvatar shape'circle' | 'square''circle'circle / square
titleWhether to show title placeholderbooleanfalsetrue / false
is-animateWhether to enable skeleton animationbooleantruetrue / false
skeleton-bg-colorSkeleton background colorstring'var(--see-info)'CSS color value
highlight-colorAnimation highlight colorstring'var(--see-bg-color)'CSS color value

Slots

NameDescription
defaultActual content displayed when loading is false

Liao ICP No. 2025070134