@molecule/app-order-timeline-solid

Feature · order-timeline · App (browser) · v1.1.3 · Apache-2.0

Order / shipment progress timeline with placed → shipped → delivered milestones + ETA

npm install @molecule/app-order-timeline-solid

npm · Source on GitHub

How it works

@molecule/app-order-timeline-solid is a ready-made order-timeline feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { type OrderMilestone, OrderTimeline } from '@molecule/app-order-timeline-solid'

const milestones: OrderMilestone[] = [
  { id: 'placed', label: 'Order placed', completed: true },
  { id: 'shipped', label: 'Shipped', completed: true, detail: 'Jun 3 via FedEx' },
  { id: 'delivery', label: 'Out for delivery', current: true },
  { id: 'delivered', label: 'Delivered' },
]

export function Delivery() {
  return <OrderTimeline milestones={milestones} eta="Estimated arrival: today by 8 pm" />
}

Works with: @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid

Reference

Solid order / shipment progress timeline.

Exports OrderTimeline and the OrderMilestone type — the vertical or horizontal milestone rail an order, shipment or delivery flow shows: "Placed → Confirmed → Shipped → Out for delivery → Delivered". It is the Solid counterpart of @molecule/app-order-timeline-react: the same props and the same DOM for the same input.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { type OrderMilestone, OrderTimeline } from '@molecule/app-order-timeline-solid'

const milestones: OrderMilestone[] = [
  { id: 'placed', label: 'Order placed', completed: true },
  { id: 'shipped', label: 'Shipped', completed: true, detail: 'Jun 3 via FedEx' },
  { id: 'delivery', label: 'Out for delivery', current: true },
  { id: 'delivered', label: 'Delivered' },
]

export function Delivery() {
  return <OrderTimeline milestones={milestones} eta="Estimated arrival: today by 8 pm" />
}

Type

feature

Installation

npm install @molecule/app-order-timeline-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

OrderMilestone

A single step in an order or shipment progress timeline.

interface OrderMilestone {
  /** Stable identifier, used as the list key. */
  id: string
  /** Display label ("Placed", "Shipped", "Delivered"): text, or JSX. */
  label: JSX.Element
  /** Optional description / timestamp / location: text, or JSX. */
  detail?: JSX.Element
  /** Is this milestone completed? */
  completed?: boolean
  /** Is this the current (in-progress) milestone? */
  current?: boolean
}

OrderTimelineProps

Props accepted by the OrderTimeline component.

interface OrderTimelineProps {
  /** The milestones, rendered in order from earliest to latest. */
  milestones: OrderMilestone[]
  /** Optional ETA / summary line: text or JSX. */
  eta?: JSX.Element
  /** Layout orientation. Defaults to `'horizontal'`. */
  orientation?: 'horizontal' | 'vertical'
  /** Extra classes on the outer wrapper. */
  className?: string
}

Functions

OrderTimeline(props)

Order / shipment progress timeline — typical e-commerce flow: "Placed → Confirmed → Shipped → Out for delivery → Delivered".

Different from <Stepper> in two ways:

  • Focuses on milestones (with optional per-step detail) rather than multi-page wizard steps.
  • Horizontal layout is responsive with connector lines between nodes.

React keys each row by the milestone's id value, so a re-ordered or re-passed array moves/keeps the rendered rows per id. Solid's For keys by reference, so the rows are keyed through stable per-id records: the record for an id is created once and reused, while the row's content reads the CURRENT milestone for that id reactively.

function OrderTimeline(props: OrderTimelineProps): JSX.Element
  • props — Component props (see OrderTimelineProps).

Returns: The rendered order timeline.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.14.0 || ^4.0.0
  • @molecule/app-ui ^1.4.0
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid
  • @molecule/app-ui
  • @molecule/app-ui-solid
  • solid-js

Requires a wired ClassMap bond — getClassMap() throws before wiring.

All strings (label, detail, eta) are caller-provided — resolve them through your app's t() before passing so the timeline localizes. JSX values are accepted too.

Status node colors are fixed hex values (blue = current, green = completed, gray = pending) rather than theme variables — the pending gray has low contrast on dark surfaces. completed and current are independent booleans: mark every finished milestone completed: true and exactly one in-progress milestone current: true; a milestone with neither renders as pending.