Nasaq
Components

Courier Card

A courier row for dispatch screens - avatar, availability, vehicle, distance and ETA from the pickup, cash float and active orders, with a selectable list wrapper.

PreviewOpen ↗

Code

<CourierList  couriers={[{ id: "c1", name: "Omar Haddad", nameAr: "عمر حداد", status: "available", vehicle: "motorbike", distanceMeters: 850, etaSeconds: 240, cashFloatMinor: 25000 }]}  selectedId={id}  onSelectCourier={setId}/>

Delivery · beta

Live examples and controls: Courier Card in the lab.

Install

npx shadcn@latest add https://docs.nasaqui.com/r/courier-card.json

One courier as a compact card, so a dispatcher can compare who is closest, free and carrying cash. CourierList stacks cards as a single-select listbox for assigning an order.

When to use

  • Picking a courier for an order in a dispatch console.
  • Showing the assigned courier in an order drawer.

When not to use

Import

import { CourierCard, CourierList } from "@fadymondy/nasaq/web";
// inside this monorepo: "@nasaq/web"

Quick start

<CourierList
  couriers={[{ id: "c1", name: "Omar Haddad", nameAr: "عمر حداد", status: "available", vehicle: "motorbike", distanceMeters: 850, etaSeconds: 240, cashFloatMinor: 25000 }]}
  selectedId={id}
  onSelectCourier={setId}
/>

Anatomy

CourierList  data-slot="courier-list"
└─ CourierCard  data-slot="courier-card"  data-status data-selected
   ├─ Avatar + status dot
   ├─ name, vehicle
   ├─ distance · ETA · cash float · active orders
   └─ actions slot

API

CourierCard

PropTypeDefaultDescription
name / nameArstringrequired / noneName; the Arabic one is used in ar.
avatarSrcstringnonePhoto; initials otherwise.
status"available" | "busy" | "offline""available"Availability badge and dot.
vehicle"bike" | "motorbike" | "car" | "van" | "walk"noneVehicle icon and label.
vehicleDetailstringnonePlate or model.
distanceMetersnumbernoneDistance from the pickup.
etaSecondsnumbernoneTime to reach the pickup.
cashFloatMinornumbernoneCash the courier holds, in minor units.
activeOrdersnumbernoneOrders in progress.
currencystring"USD" ("SAR" in Arabic)ISO currency for the float.
selected / onSelectboolean / () => voidnoneSelection; makes the card a button.
actionsReactNodenoneTrailing slot, for example an Assign button.
compactbooleanfalseTighter layout.
locale / labels"en" | "ar" / partial stringscontextLanguage and overrides.

CourierList

PropTypeDefaultDescription
couriers(CourierCardProps & { id: string })[]requiredCouriers to list.
selectedIdstring | nullnoneSelected courier.
onSelectCourier(id: string) => voidnoneSelection callback.
locale / labelsas abovecontextLanguage and overrides.

Examples

See the lab stories: list with selection, single, compact, other currency and Arabic.

Accessibility

KeyAction
TabMoves to the next selectable card.
Enter / SpaceSelects the card.

Status is text as well as colour. The selected card carries aria-pressed.

RTL & i18n

Layout uses logical properties. Arabic names, labels and units are built in; numbers and the currency follow the locale.

Styling & tokens

Uses --status-* tokens for the dot and --brand for the selected ring. Target [data-status] and [data-selected].

Do / Don't

  • Do sort the list by ETA before rendering.
  • Don't hide the cash float; dispatchers rely on it.

DispatchOffer, RouteStops, MapView.

Lab

https://docs.nasaqui.com/?path=/docs/components-delivery-courier-card--docs

On this page