App

Step List.

A compact progress list for background work: one line per step with a done, current, todo or error mark and a time on the right.

  1. Done: Planned 3 pages and an app0:21
  2. Done: Wrote index.json, about.json0:48
  3. Done: Wrote app.lua1:12
  4. In progress: Testing requests 3 of 51:19
  5. Not started: Preview and publish

Installation#

With the CLI

$npx lanterncn add step-list

This also installs the Lantern theme and any Lantern UI components it depends on. The shadcn CLI works directly too: npx shadcn@latest add httptim/lantern-ui/step-list. See Installation if your project is not set up yet.

Manually

  1. Install the dependencies

    npm install lucide-react
  2. Copy the source into your project

    components/ui/step-list.tsx
    import * as React from "react";
    import { CheckIcon, XIcon } from "lucide-react";
    
    import { cn } from "@/lib/utils";
    
    type StepListState = "done" | "current" | "todo" | "error";
    
    const stateLabel: Record<StepListState, string> = {
      done: "Done",
      current: "In progress",
      todo: "Not started",
      error: "Failed",
    };
    
    /** A compact progress list for background work: one line per step with a mark and a time. */
    function StepList({ className, ...props }: React.ComponentProps<"ol">) {
      return <ol data-slot="step-list" className={cn("flex flex-col gap-2.5", className)} {...props} />;
    }
    
    function StepListItem({
      className,
      state = "todo",
      time,
      children,
      ...props
    }: React.ComponentProps<"li"> & {
      state?: StepListState;
      /** Time the step finished or has been running, e.g. "0:48". */
      time?: React.ReactNode;
    }) {
      return (
        <li
          data-slot="step-list-item"
          data-state={state}
          aria-current={state === "current" ? "step" : undefined}
          className={cn(
            "flex min-w-0 items-start gap-2.5 text-[13px] leading-5",
            state === "todo" ? "text-muted-foreground" : "text-foreground",
            className,
          )}
          {...props}
        >
          <span data-slot="step-list-mark" aria-hidden="true" className="flex h-5 w-4 shrink-0 items-center justify-center">
            {state === "done" && <CheckIcon className="size-3.5 text-success" />}
            {state === "error" && <XIcon className="size-3.5 text-destructive" />}
            {state === "current" && (
              <span className="size-2.5 animate-lantern-pulse rounded-full border-2 border-primary [animation-duration:1.4s]" />
            )}
            {state === "todo" && <span className="size-2.5 rounded-full border border-input" />}
          </span>
          <span className="sr-only">{stateLabel[state]}: </span>
          <span data-slot="step-list-label" className="min-w-0 flex-1">
            {children}
          </span>
          {time != null && (
            <span
              data-slot="step-list-time"
              className="shrink-0 font-mono text-[11px] leading-5 text-muted-foreground tabular-nums"
            >
              {time}
            </span>
          )}
        </li>
      );
    }
    
    export { StepList, StepListItem, type StepListState };
  3. Update the import paths to match your project

    The source imports cn from @/lib/utils.

Usage#

import { StepList, StepListItem } from "@/components/ui/step-list";
<StepList aria-label="Build progress">
  <StepListItem state="done" time="0:48">Wrote index.json</StepListItem>
  <StepListItem state="current" time="1:19">Testing requests 3 of 5</StepListItem>
  <StepListItem>Preview and publish</StepListItem>
</StepList>

Use Step List for work the app is doing (a build, a deploy, an AI run). Use Stepper for numbered steps a person follows, such as an install guide.

Each item reads its state to screen readers before the label, and the current one gets aria-current="step".

Examples#

Failed step

  1. Done: Uploaded 6 files to north hub0:04
  2. Failed: Reboot failedstartup.lua:12: attempt to index nil value0:09
  3. Not started: Announce on the network