vwf .

API Reference

Complete API documentation for components, utilities, and framework core

Reference/API/Skeleton

Skeleton

Loading placeholders with shimmer animation

🔧 Props

PropertyTypeDefaultDescription
variantstring'text''text', 'title', 'avatar', 'button', 'card', 'image', 'custom'
widthstringvariant-specificWidth (CSS value)
heightstringvariant-specificHeight (CSS value)
roundedstring'md'Border radius (Tailwind value)
animatebooleantrueEnable shimmer animation
linesnumber3Number of lines (text variant only)
classstring-Additional Tailwind classes

✨ Features

Hardware-accelerated shimmer animation (2s duration)

7 pre-configured variants for common use cases

7 pre-built composite skeletons (Card, ListItem, Profile, etc.)

Respects prefers-reduced-motion (when implemented)

Full Tailwind customization via filterClassName

💻 Examples

Loading Card

const loading = van.state(true);
setTimeout(() => loading.val = false, 12000);

return () => loading.val
  ? CardSkeleton()
  : Card({ class: 'p-4' }, p('Card loaded!'));

▶️ Live Preview

💡 Click "Edit Code" to modify the example

🔄 Click "Apply Changes" to see your modifications

↩️ Click "Reset" to restore original code

Custom Skeleton

return Skeleton({
  variant: 'custom',
  width: '100%',
  height: '200px',
  rounded: 'xl'
});

▶️ Live Preview

💡 Click "Edit Code" to modify the example

🔄 Click "Apply Changes" to see your modifications

↩️ Click "Reset" to restore original code

💡 Usage Tips

🔗 Related

Explore vwf

Discover what vwf can do