SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

OrderSteps

An order on its way.

Your food is being madeArriving in18 min
  1. Order placed
  2. Restaurant accepted
  3. Being prepared
  4. Courier picked it up
  5. On the way
  6. Delivered
View code
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

PropTypeRequiredDescription
stepsStep[]Yes
currentstringYesThe id of the step reached; every earlier one is done.

Also accepts everything in Omit<TagProps<"ol">, "children">.

Other components this module publishes.

  • orderStepState
  • parseOrderLine
@sdxc/ui

Can’t find it? Contact us