WlStatCard

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

Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.

Settings

tone

Accent tone.

icon

Label icon.

label

Metric label.

value

Value (when no slot is provided).

description

Description below the value.

progress

Progress from 0 to 100. Displays an indicator when set.

locale

Locale override for numeric display formatting.

delta

Numeric change displayed beside the primary statistic.

Props numberFormat, models, handlers and slots can be edited in the SFC. See their descriptions in API.

Example

Completed
24
Of 32 materials
Focus: outside the example · pointer: outside the example

Explore the live example and copy its Vue SFC into your application. Settings on the left can be combined.

Code for your application

Vue SFC · current settings
<script setup lang="ts">
import { WlStatCard } from "legato-ui";
</script>

<template>
  <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>
</template>

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
Vue SFC · additional 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>