SkeletonItem
Builds custom skeleton layouts from text, circle, rectangle and image blocks.
Import
Use <hui-skeleton-item> after configuring uni-app easycom. Import public types and functions from @nscode/handy-uni. Ordinary Vue applications install the @nscode/handy-uni/web preview plugin.
Examples
Each example is standalone. Controls show the current value or event result on the page.
<template>
<view>
<hui-space direction="vertical" fill>
<hui-skeleton-item
v-for="variant in variants"
:key="variant"
custom-class="hui-space__item"
:variant="variant"
:width="variant === 'circle' ? 40 : '80%'"
/>
</hui-space>
</view>
</template>
<script setup lang="ts">
const variants = ['text', 'circle', 'rect', 'image'] as const
</script>
Props
| Prop | Type | Default | Details |
|---|---|---|---|
variant | SkeletonItemVariant | 'text' | Placeholder shape: text, circle, rect or image. |
width | number | string | — | Width; numbers use px and strings preserve their unit. |
height | number | string | — | Height; numbers use px and strings preserve their unit. |
Root classes and styles use customClass and customStyle. Numbers representing dimensions use px; durations use ms unless explicitly documented.
Events
None.
Slots
None.
Methods
None.
Types
SkeletonItemVariant、SkeletonItemProps、SkeletonItemEmits.
Platform notes
Supports H5, WeChat mini-program, App-vue and ordinary Vue 3 Web through shared platform components. Unit tests do not replace device acceptance; verify touch, screen readers, deactivation and native rendering on each target.
Device smoke checklist.