WlStatCard

Metric card with icon, label, value and description. Can include a progress bar.
Components / Data v0.1.0

Appearance

Completed
24
Of 32 materials
Full example
<div class="wl-stack" data-space="md">
  <WlStatCard
    icon="task"
    label="Completed"
    value="24"
    description="Of 32 materials"
    :progress="75"
    
  ><template #footer>{{ "Over the past week" }}</template></WlStatCard>
</div>

Content

Completed
24
Of 32 materials
Full example
<div class="wl-stack" data-space="md">
  <WlStatCard
    icon="task"
    label="Completed"
    value="24"
    description="Of 32 materials"
    :progress="75"
    
  ><template #footer>{{ "Over the past week" }}</template></WlStatCard>
</div>

Metrics, tone and progress

Accent/success, label/description, progress, default slot value, footer and updating a metric.

Tasks completed
7
of 10 tasks in the local example
Team focus
Release plan
2 of 5 sections ready
Review time
1 h 20 min
during this session
Full example
<script setup lang="ts">
import { WlButton, WlStatCard } from "legato-ui";
import { ref } from "vue";
const completed = ref(7);
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <div class="showcase-stats">
      <WlStatCard
        icon="check"
        label="Tasks completed"
        :value="String(completed)"
        description="of 10 tasks in the local example"
        :progress="completed * 10"
        tone="success"
      />
      <WlStatCard
        icon="eye"
        label="Team focus"
        value="Release plan"
        description="2 of 5 sections ready"
        :progress="40"
      />
      <WlStatCard icon="clock" label="Review time" description="during this session">
        <strong>{{ "1 h 20 min" }}</strong>
        <template #footer>
          <span class="wl-text-small wl-text-muted">
            {{ "The default slot replaces value. Add an explanation in the footer." }}
          </span>
        </template>
      </WlStatCard>
    </div>
    <div class="wl-inline" data-space="sm">
      <WlButton size="sm" :disabled="completed === 10" @click="completed++">
        {{ "Complete a task in this example" }}
      </WlButton>
      <WlButton size="sm" variant="ghost" @click="completed = 7">{{ "Restore initial metric" }}</WlButton>
    </div>
  </div>
</template>

<style scoped>
.showcase-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--wl-space-lg); }
</style>