On this page

Trace

Live examples of Trace, with the exact Vue file that renders each one.

Every example is a complete Vue file. Copy it into an app that has the registry installed, or open it in StackBlitz.

The steps of a run

Done, running and pending steps. Each status has its own icon and words; colour is only a second cue.

Fetched 120 new orders from the online store4 sMatched 118 products to ERP items2 sCreating sales orders in the ERP64 of 120Update stock in the online storeWaiting
TraceRun.vue
<script setup lang="ts">
import { CircleCheck, CircleDashed, LoaderCircle } from '@lucide/vue'
import { Trace, TraceDescription, TraceIcon, TraceLine, TraceTitle } from '@/components/ui/trace'

// The steps of one order sync run. Each status has its own icon and words; colour is a second cue.
// A running step's title shimmers; a pending step is lighter text, never transparent.
</script>

<template>
  <Trace class="max-w-md">
    <TraceLine>
      <TraceIcon><CircleCheck /></TraceIcon>
      <TraceTitle>Fetched 120 new orders from the online store</TraceTitle>
      <TraceDescription>4 s</TraceDescription>
    </TraceLine>
    <TraceLine>
      <TraceIcon><CircleCheck /></TraceIcon>
      <TraceTitle>Matched 118 products to ERP items</TraceTitle>
      <TraceDescription>2 s</TraceDescription>
    </TraceLine>
    <TraceLine status="running">
      <TraceIcon><LoaderCircle class="animate-spin" /></TraceIcon>
      <TraceTitle>Creating sales orders in the ERP</TraceTitle>
      <TraceDescription>64 of 120</TraceDescription>
    </TraceLine>
    <TraceLine status="pending">
      <TraceIcon><CircleDashed /></TraceIcon>
      <TraceTitle>Update stock in the online store</TraceTitle>
      <TraceDescription>Waiting</TraceDescription>
    </TraceLine>
  </Trace>
</template>

Steps with details

A step opens to show its details. The failed step starts open, so the reason is on screen.

SO-10482: the customer does not exist in the ERP. SO-10487: the item is blocked for sale in warehouse WH-HCM.
TraceExpandable.vue
<script setup lang="ts">
import { CircleCheck, CircleX } from '@lucide/vue'
import {
  Trace,
  TraceCollapsible,
  TraceCollapsibleContent,
  TraceCollapsibleTrigger,
  TraceDescription,
  TraceIcon,
  TraceLine,
  TraceTitle,
} from '@/components/ui/trace'

// A step with details opens in place. The failed step starts open so the reason is on screen.
</script>

<template>
  <Trace class="max-w-md">
    <TraceCollapsible>
      <TraceCollapsibleTrigger>
        <TraceLine>
          <TraceIcon><CircleCheck /></TraceIcon>
          <TraceTitle>Fetched 120 new orders</TraceTitle>
          <TraceDescription>4 s</TraceDescription>
        </TraceLine>
      </TraceCollapsibleTrigger>
      <TraceCollapsibleContent>
        From the online store, created between 08:00 and 09:00. 3 orders were skipped because they were already in the ERP.
      </TraceCollapsibleContent>
    </TraceCollapsible>
    <TraceCollapsible default-open>
      <TraceCollapsibleTrigger>
        <TraceLine status="error">
          <TraceIcon><CircleX /></TraceIcon>
          <TraceTitle>Failed to create 2 sales orders</TraceTitle>
          <TraceDescription>9 s</TraceDescription>
        </TraceLine>
      </TraceCollapsibleTrigger>
      <TraceCollapsibleContent>
        SO-10482: the customer does not exist in the ERP. SO-10487: the item is blocked for sale in warehouse WH-HCM.
      </TraceCollapsibleContent>
    </TraceCollapsible>
  </Trace>
</template>

Steps that open a record

Put a line inside a link to open what the step touched.

TraceLinks.vue
<script setup lang="ts">
import { FileText, Package } from '@lucide/vue'
import { Trace, TraceDescription, TraceIcon, TraceLine, TraceTitle } from '@/components/ui/trace'

// Lines that open a record. Put the TraceLine inside a link or button: the line darkens on hover
// and the link takes the focus outline.
</script>

<template>
  <Trace class="max-w-md">
    <a href="#order-SO-10482">
      <TraceLine>
        <TraceIcon><FileText /></TraceIcon>
        <TraceTitle>Read order SO-10482</TraceTitle>
        <TraceDescription>CRM</TraceDescription>
      </TraceLine>
    </a>
    <a href="#item-TSHIRT-BLK-M">
      <TraceLine>
        <TraceIcon><Package /></TraceIcon>
        <TraceTitle>Checked stock of TSHIRT-BLK-M</TraceTitle>
        <TraceDescription>ERP</TraceDescription>
      </TraceLine>
    </a>
  </Trace>
</template>