WlSkeleton

Skeleton while content loads.
Components / Data v0.1.0

Appearance

Full example
<div class="wl-stack" data-space="md">
  <div
    role="status"
    aria-label="Loading materials"
    aria-busy="true"
    class="wl-stack"
    data-space="sm"
  >
    <WlSkeleton preset="avatar" />
    <WlSkeleton preset="text" :lines="3"  />
  </div>
</div>

Size and density

Full example
<div class="wl-stack" data-space="md">
  <div
    role="status"
    aria-label="Loading materials"
    aria-busy="true"
    class="wl-stack"
    data-space="sm"
  >
    <WlSkeleton preset="avatar" />
    <WlSkeleton preset="text" :lines="3"  />
  </div>
</div>

Card while loading

Rectangle/circle, sizes and radius, aria-busy with an explanation and transition to real content.

Loading member card…

Full example
<script setup lang="ts">
import { WlAvatar, WlButton, WlSkeleton } from "legato-ui";
import { ref } from "vue";
const loading = ref(true);
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <div>
      <WlButton size="sm" @click="loading = !loading">
        {{ loading ? "Show loaded card" : "Reload card" }}
      </WlButton>
    </div>
    <article
      class="wl-surface wl-stack"
      data-space="lg"
      :aria-busy="loading"
      aria-label="Member card"
    >
      <div v-if="loading" class="wl-stack" data-space="md">
        <div class="wl-inline" data-space="md">
          <WlSkeleton shape="circle" width="40px" height="40px" />
          <div class="showcase-skeleton-lines wl-stack" data-space="sm">
            <WlSkeleton height="14px" width="70%" /><WlSkeleton height="11px" width="45%" />
          </div>
        </div>
        <WlSkeleton height="12px" /><WlSkeleton height="12px" width="80%" /><WlSkeleton height="48px" border-radius="8px" />
      </div>
      <div v-else class="wl-stack" data-space="md">
        <div class="wl-inline" data-space="md">
          <WlAvatar label="DG" :size="36" />
          <h3 class="wl-text-subheading">{{ "Dmitry" }}</h3>
        </div>
        <p class="wl-text-body">{{ "Materials are ready for review. Rectangle and circle showed the element shapes while loading." }}</p>
      </div>
    </article>
    <p class="wl-text-small" role="status">
      {{ loading ? "Loading member card…" : "Member card loaded." }}
    </p>
  </div>
</template>

<style scoped>
.showcase-skeleton-lines { flex: 1; min-width: 0; }
</style>