Nasaq
Components

Route Stops

An ordered multi-order trip - pickups and drop-offs with done, current and failed states, cash per stop, a trip summary and a per-stop action slot.

PreviewOpen ↗

Code

<RouteStops stops={[{ id: "p1", kind: "pickup", name: "Bakery" }, { id: "d1", kind: "dropoff", name: "Sara", cashMinor: 10000 }]} />

Delivery · beta

Live examples and controls: Route Stops in the lab.

Install

npx shadcn@latest add https://docs.nasaqui.com/r/route-stops.json

The courier's to-do list for a trip. The first stop that is not done is the current one and gets the actions.

When to use

  • A courier trip with several pickups and drop-offs.

When not to use

Import

import { RouteStops } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"

Quick start

<RouteStops stops={[{ id: "p1", kind: "pickup", name: "Bakery" }, { id: "d1", kind: "dropoff", name: "Sara", cashMinor: 10000 }]} />

Anatomy

RouteStops  data-slot="route-stops"
├─ summary: stops, cash to collect
└─ ol > li  data-slot="route-stop"  data-kind data-status data-current
   ├─ marker, name, address, order ref, ETA, note
   └─ actions (current stop, or all)

API

PropTypeDefaultDescription
stopsRouteStop[]requiredid, kind (pickup/dropoff), name, nameAr, address, addressAr, status (pending/done/failed), orderRef, cashMinor, eta, note, noteAr.
currencystring"USD" ("SAR" in Arabic)ISO currency.
onSelectStop(stop) => voidnoneMakes stops clickable.
renderActions(stop, { current }) => ReactNodenonePer-stop actions.
actionsForAllbooleanfalseShow actions on every stop, not just the current one.
hideSummarybooleanfalseHide the trip summary.
locale / labels"en" | "ar" / partial stringscontextLanguage and overrides.

Examples

Lab stories: interactive trip, read-only, all done, Arabic.

Accessibility

An ordered list; the current stop has aria-current="step". Selectable stops are buttons.

RTL & i18n

Logical layout, Arabic names and notes via nameAr, addressAr, noteAr.

Styling & tokens

Uses --status-success, --status-danger, --brand. Target [data-current], [data-kind], [data-status].

Do / Don't

  • Do give each stop an orderRef on multi-order trips.
  • Don't show actions on future stops.

DispatchOffer, CashCollect, MapView.

Lab

https://docs.nasaqui.com/?path=/docs/components-delivery-route-stops--docs

On this page