@molecule/app-order-timeline-vue

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-vue

npm · Source on GitHub

How it works

@molecule/app-order-timeline-vue 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 { createApp, defineComponent, h } from 'vue'
import { OrderTimeline, type OrderMilestone } from '@molecule/app-order-timeline-vue'

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' },
]

const App = defineComponent({
  setup() {
    return () => h(OrderTimeline, { milestones, eta: 'Estimated arrival: today by 8 pm' })
  },
})

createApp(App).mount('#app')

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

Reference

Vue 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 Vue 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 { createApp, defineComponent, h } from 'vue'
import { OrderTimeline, type OrderMilestone } from '@molecule/app-order-timeline-vue'

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' },
]

const App = defineComponent({
  setup() {
    return () => h(OrderTimeline, { milestones, eta: 'Estimated arrival: today by 8 pm' })
  },
})

createApp(App).mount('#app')

Type

feature

Installation

npm install @molecule/app-order-timeline-vue @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue

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 a node. */
  label: VNodeChild
  /** Optional description / timestamp / location: text, or a node. */
  detail?: VNodeChild
  /** 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: a prop, or the same-named slot. Text and
   * nodes both work.
   */
  eta?: VNodeChild
  /** Layout orientation. Defaults to `'horizontal'`. */
  orientation?: 'horizontal' | 'vertical'
  /** Extra classes on the outer wrapper. */
  className?: string
}

Constants

OrderTimeline

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.
const OrderTimeline: DefineComponent<
  ExtractPropTypes<{
    milestones: { type: PropType<OrderMilestone[]>; required: true }
    eta: null
    orientation: { type: PropType<'horizontal' | 'vertical'>; default: string }
    className: StringConstructor
  }>,
  () => VNode,
  {},
  {},
  {},
  ComponentOptionsMixin,
  ComponentOptionsMixin,
  {},
  string,
  PublicProps,
  Readonly<
    ExtractPropTypes<{
      milestones: { type: PropType<OrderMilestone[]>; required: true }
      eta: null
      orientation: { type: PropType<'horizontal' | 'vertical'>; default: string }
      className: StringConstructor
    }>
  > &
    Readonly<{}>,
  { orientation: 'horizontal' | 'vertical' },
  {},
  {},
  {},
  string,
  ComponentProvideOptions,
  true,
  {},
  any
>
  • props — Component props (see OrderTimelineProps).

Returns: The order timeline component.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-ui ^1.4.0
  • @molecule/app-ui-vue ^1.1.0
  • @molecule/app-vue ^3.13.0 || ^4.0.0
  • vue ^3.4.0

Runtime Dependencies

  • @molecule/app-ui
  • @molecule/app-ui-vue
  • @molecule/app-vue
  • vue

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. Node values are accepted too: pass them as props or as same-named slots.

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.