Blocks Design System

Order tracking

An order status page: the order number and a status Badge, the delivery estimate as the Heading, a progress tracker from Ordered to Delivered, a timeline of carrier updates, the items in the shipment in a Card, and help actions as Button links. It is all Server Components.

Order NF-20418 · placed Nov 28Out for delivery

Arriving today by 8 pm

To Dana Whitfield, 88 River Road, Tacoma, WA

  1. Completed: OrderedNov 28
  2. Completed: PackedNov 29
  3. Completed: ShippedNov 30
  4. Current step: Out for deliveryToday, 7:12 am
  5. Next: DeliveredBy 8 pm today

Carrier updates

Ridgeway Parcel · tracking 1RP 4471 9920

  1. Out for delivery · Tacoma, WA
  2. Arrived at local facility · Tacoma, WA
  3. Departed regional hub · Portland, OR
  4. Picked up by carrier · Bend, OR
  5. Shipping label created · Bend, OR

In this shipment

  • Ridgeline insulated jacketSpruce · M · Qty 1
  • Merino trail socks, 3 pairsCharcoal · L · Qty 2
Source · recipes/order-tracking.tsx
recipes/order-tracking.tsx
import { Badge, Body, BodySmall, Button, Card, Heading, Link, Stack, Text } from '@blocks/design-system'
import { Check, CircleHelp, Footprints, House, MapPin, MessageCircle, Shirt, Truck } from 'lucide-react'
import styles from './order-tracking.module.css'

const steps = [
  { label: 'Ordered', when: 'Nov 28' },
  { label: 'Packed', when: 'Nov 29' },
  { label: 'Shipped', when: 'Nov 30' },
  { label: 'Out for delivery', when: 'Today, 7:12 am' },
  { label: 'Delivered', when: 'By 8 pm today' },
]
const currentStep = 3

type StepState = 'done' | 'current' | 'upcoming'

// Spoken before each step's label, since the dot's fill is only visual.
const statePrefix: Record<StepState, string> = { done: 'Completed: ', current: 'Current step: ', upcoming: 'Next: ' }

const updates = [
  { time: '2026-12-02T07:12', date: 'Dec 2', clock: '7:12 am', status: 'Out for delivery', place: 'Tacoma, WA' },
  { time: '2026-12-02T04:40', date: 'Dec 2', clock: '4:40 am', status: 'Arrived at local facility', place: 'Tacoma, WA' },
  { time: '2026-12-01T21:05', date: 'Dec 1', clock: '9:05 pm', status: 'Departed regional hub', place: 'Portland, OR' },
  { time: '2026-11-30T18:18', date: 'Nov 30', clock: '6:18 pm', status: 'Picked up by carrier', place: 'Bend, OR' },
  { time: '2026-11-30T14:02', date: 'Nov 30', clock: '2:02 pm', status: 'Shipping label created', place: 'Bend, OR' },
]

const items = [
  { name: 'Ridgeline insulated jacket', detail: 'Spruce · M', quantity: 1, icon: Shirt },
  { name: 'Merino trail socks, 3 pairs', detail: 'Charcoal · L', quantity: 2, icon: Footprints },
]

// An order status page from Server Components. The progress tracker is an
// ordered list with aria-current on the current step; a container query turns
// it from a vertical list on a phone into a horizontal track.
export default function OrderTracking() {
  return (
    <article aria-labelledby="order-tracking-title" className={styles.root}>
      <Stack gap="xl">
        <Stack gap="sm">
          <Stack direction="row" gap="sm" align="center" wrap="wrap">
            <Text fontSize="sm" color="text-muted">
              Order NF-20418 · placed Nov 28
            </Text>
            <Badge tone="info">
              <Truck aria-hidden />
              Out for delivery
            </Badge>
          </Stack>
          <Heading as="h2" id="order-tracking-title" fontSize="xxl">
            Arriving today by 8&nbsp;pm
          </Heading>
          <Body margin="none" color="text-muted">
            <MapPin aria-hidden className={styles.inlineIcon} /> To Dana Whitfield, 88 River Road, Tacoma, WA
          </Body>
        </Stack>

        <ol aria-label="Order progress" className={styles.tracker}>
          {steps.map((step, index) => {
            const state: StepState = index < currentStep ? 'done' : index === currentStep ? 'current' : 'upcoming'
            return (
              <li key={step.label} data-state={state} aria-current={state === 'current' ? 'step' : undefined} className={styles.step}>
                <span aria-hidden className={styles.dot}>
                  {state === 'done' && <Check />}
                  {state === 'current' && <Truck />}
                </span>
                <span className={styles.stepText}>
                  <span className={styles.visuallyHidden}>{statePrefix[state]}</span>
                  <Text fontSize="sm" fontWeight="semibold" color={state === 'upcoming' ? 'text-muted' : 'text'}>
                    {step.label}
                  </Text>
                  <Text fontSize="xs" color="text-muted">
                    {step.when}
                  </Text>
                </span>
              </li>
            )
          })}
        </ol>

        <div className={styles.columns}>
          <Stack as="section" gap="md" aria-labelledby="order-tracking-updates">
            <Stack gap="none">
              <Heading as="h3" id="order-tracking-updates" fontSize="md">
                Carrier updates
              </Heading>
              <BodySmall margin="none" color="text-muted">
                Ridgeway Parcel · tracking <Link href="#order-tracking-carrier">1RP 4471 9920</Link>
              </BodySmall>
            </Stack>
            <ol className={styles.timeline}>
              {updates.map((update) => (
                <li key={update.time}>
                  <Text fontSize="sm" fontWeight="semibold">
                    {update.status}
                  </Text>
                  <Text fontSize="xs" color="text-muted">
                    <time dateTime={update.time}>
                      {update.date}, {update.clock}
                    </time>{' '}
                    · {update.place}
                  </Text>
                </li>
              ))}
            </ol>
          </Stack>

          <Stack gap="lg">
            <Card as="section" aria-labelledby="order-tracking-items" padding="lg" borderRadius="xl">
              <Stack gap="md">
                <Heading as="h3" id="order-tracking-items" fontSize="md">
                  In this shipment
                </Heading>
                <Stack as="ul" gap="md" dangerouslySetClassName={styles.list}>
                  {items.map((item) => (
                    <Stack as="li" key={item.name} direction="row" gap="md" align="center">
                      <span className={styles.art}>
                        <item.icon aria-hidden />
                      </span>
                      <Stack gap="none">
                        <Text fontSize="sm" fontWeight="semibold">
                          {item.name}
                        </Text>
                        <Text fontSize="xs" color="text-muted">
                          {item.detail} · Qty {item.quantity}
                        </Text>
                      </Stack>
                    </Stack>
                  ))}
                </Stack>
              </Stack>
            </Card>

            <Stack as="nav" gap="sm" aria-label="Help with this order">
              <Button as="a" href="#order-tracking-instructions">
                <House aria-hidden className={styles.icon} />
                Change delivery instructions
              </Button>
              <Button as="a" href="#order-tracking-problem" variant="ghost">
                <CircleHelp aria-hidden className={styles.icon} />
                Report a problem
              </Button>
              <Button as="a" href="#order-tracking-support" variant="ghost">
                <MessageCircle aria-hidden className={styles.icon} />
                Chat with support
              </Button>
            </Stack>
          </Stack>
        </div>
      </Stack>
    </article>
  )
}
Order NF-20418

How it works

  • The tracker is an ordered list. The current step carries aria-current="step", and each step starts with hidden text (“Completed”, “Current step”, “Next”), because the filled and ringed dots are only visual.
  • A container query switches the same list from a vertical rail on a phone to a horizontal track once the example is 32rem wide. The connectors are drawn by the app’s CSS and turn the accent color behind completed steps.
  • Carrier updates are another ordered list, newest first, with time elements carrying the full timestamp. The newest event’s dot is highlighted to match the current step.
  • The help actions are links in a labelled nav, since each one goes somewhere else: delivery instructions, a problem report or a support chat.

App-owned CSS

recipes/order-tracking.module.css
.root {
  container-type: inline-size;
  --dot: var(--ds-control-height-sm);
}

.inlineIcon,
.icon {
  width: var(--ds-icon-size-sm);
  height: var(--ds-icon-size-sm);
}

.inlineIcon {
  vertical-align: text-bottom;
}

.visuallyHidden {
  position: absolute;
  width: var(--ds-space-xxs);
  height: var(--ds-space-xxs);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Progress tracker: vertical by default, a connector under each dot. */
.tracker {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: var(--ds-space-md);
  padding-bottom: var(--ds-space-lg);

  &::before {
    content: "";
    position: absolute;
    top: var(--dot);
    bottom: 0;
    left: calc(var(--dot) / 2 - var(--ds-border-width-sm));
    width: var(--ds-border-width-md);
    background-color: var(--ds-color-border);
  }

  &:last-child {
    padding-bottom: 0;
  }

  &:last-child::before {
    display: none;
  }

  &[data-state="done"]::before {
    background-color: var(--ds-color-accent);
  }
}

.dot {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--dot);
  height: var(--dot);
  background-color: var(--ds-color-bg);
  border: var(--ds-border-width-md) solid var(--ds-color-border);
  border-radius: var(--ds-border-radius-circle);

  & svg {
    width: var(--ds-icon-size-sm);
    height: var(--ds-icon-size-sm);
  }

  [data-state="done"] > & {
    color: var(--ds-color-accent-fg);
    background-color: var(--ds-color-accent);
    border-color: var(--ds-color-accent);
  }

  [data-state="current"] > & {
    color: var(--ds-color-accent-text);
    background-color: var(--ds-color-accent-subtle);
    border-color: var(--ds-color-accent);
    box-shadow: 0 0 0 var(--ds-space-sm) color-mix(in srgb, var(--ds-color-accent) 20%, transparent);
  }
}

.stepText {
  display: flex;
  flex-direction: column;
  padding-top: var(--ds-space-xs);
}

/* With room, the same list becomes a horizontal track. */
@container (min-width: 32rem) {
  .tracker {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .step {
    grid-template-columns: none;
    justify-items: center;
    row-gap: var(--ds-space-sm);
    padding-bottom: 0;
    text-align: center;

    &::before {
      top: calc(var(--dot) / 2 - var(--ds-border-width-sm));
      right: calc(var(--dot) / 2 + var(--ds-space-xs) - 50%);
      bottom: auto;
      left: calc(50% + var(--dot) / 2 + var(--ds-space-xs));
      width: auto;
      height: var(--ds-border-width-md);
    }
  }

  .stepText {
    padding-top: 0;
  }
}

/* Updates beside the shipment once there's room for both. */
.columns {
  display: grid;
  gap: var(--ds-space-xl);
}

@container (min-width: 36rem) {
  .columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* Carrier updates: a rail with the newest event highlighted. */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;

  & li {
    position: relative;
    display: flex;
    flex-direction: column;
    padding-left: var(--ds-space-lg);
    padding-bottom: var(--ds-space-lg);
    border-left: var(--ds-border-width-md) solid var(--ds-color-border-subtle);
    margin-left: var(--ds-space-sm);
  }

  & li:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
  }

  & li::before {
    content: "";
    position: absolute;
    top: var(--ds-space-sm);
    left: calc(var(--ds-space-sm) / -2 - var(--ds-border-width-md) / 2 - var(--ds-border-width-sm));
    width: calc(var(--ds-space-sm) + var(--ds-border-width-md));
    height: calc(var(--ds-space-sm) + var(--ds-border-width-md));
    background-color: var(--ds-color-border-strong);
    border-radius: var(--ds-border-radius-circle);
  }

  & li:first-child::before {
    background-color: var(--ds-color-accent);
    box-shadow: 0 0 0 var(--ds-space-xs) var(--ds-color-accent-subtle);
  }
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.art {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--ds-control-height-lg);
  height: var(--ds-control-height-lg);
  color: var(--ds-color-text-muted);
  background-color: var(--ds-color-bg-subtle);
  border-radius: var(--ds-border-radius-md);

  & svg {
    width: var(--ds-icon-size-md);
    height: var(--ds-icon-size-md);
  }
}