Create a Skeleton Loader component.

Code Playground
JavaScript (V8)
Loading...
Console Output
// Output will appear here...
// For React: ReactDOM.createRoot(rootElement).render(<App />);
Recommended Answer
<template>
  <div class="skeleton" :style="{ width: width, height: height }"></div>
</template>

<style scoped>
.skeleton {
  background: #eee;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
</style>

<script setup>
defineProps({ width: String, height: String });
</script>