OrderSteps
An order on its way.
Your food is being madeArriving in18 min
- Order placed
- Restaurant accepted
- Being prepared
- Courier picked it up
- On the way
- Delivered
View code
<div id="order">
<h1 data-order-headline>Your food is being made</h1>
<span data-order-eta-label>Arriving in</span> <span data-order-eta>18 min</span>
<OrderSteps steps={steps} current="preparing" />
<OrderLive
src={`/orders/${order.id}/progress`}
root="order"
steps={steps.map((step) => step.id)}
headlines={headlines}
labels={{ arriving: "Arriving in", arrived: "Delivered", done: "Arrived", minutes: "{n} min" }}
/>
</div>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { OrderSteps } from "@sdxc/ui/commerce";Renders the steps as a vertical timeline: a filled dot and rail for each done step, a ring that pulses on the current one, and hollow dots for the rest.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
steps | Step[] | Yes | |
current | string | Yes | The id of the step reached; every earlier one is done. |
Also accepts everything in Omit<TagProps<"ol">, "children">.
Also exported
Other components this module publishes.
orderStepStateparseOrderLine