@molecule/app-order-timeline-svelte
Feature · order-timeline · App (browser) · v1.1.5 · Apache-2.0
Order / shipment progress timeline with placed → shipped → delivered milestones + ETA
npm install @molecule/app-order-timeline-svelteHow it works
@molecule/app-order-timeline-svelte 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.
<script lang="ts">
import { type OrderMilestone, OrderTimeline } from '@molecule/app-order-timeline-svelte'
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' },
]
</script>
<OrderTimeline {milestones} eta="Estimated arrival: today by 8 pm" />Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte
Reference
Svelte order / shipment progress timeline.
Exports OrderTimeline and the OrderMilestone type — the milestone rail an
order, shipment or delivery flow shows: "Placed → Confirmed → Shipped → Out
for delivery → Delivered". It is the Svelte 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.tsJSDoc, not this file.
Quick Start
<script lang="ts">
import { type OrderMilestone, OrderTimeline } from '@molecule/app-order-timeline-svelte'
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' },
]
</script>
<OrderTimeline {milestones} eta="Estimated arrival: today by 8 pm" />
Type
feature
Installation
npm install @molecule/app-order-timeline-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte
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 snippet. */
label: string | Snippet
/** Optional description / timestamp / location: text, or a snippet. */
detail?: string | Snippet
/** 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 a snippet. */
eta?: string | Snippet
/** Layout orientation. Defaults to `'horizontal'`. */
orientation?: 'horizontal' | 'vertical'
/** Extra classes on the outer wrapper. */
className?: string
}
Constants
OrderTimeline
const OrderTimeline: LegacyComponentType
Injection Notes
Requirements
Peer dependencies:
@molecule/app-svelte^3.13.0 || ^4.0.0@molecule/app-ui^1.4.0@molecule/app-ui-svelte^1.6.0svelte^5.0.0
Runtime Dependencies
@molecule/app-svelte@molecule/app-ui@molecule/app-ui-sveltesvelte
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. Snippets
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.