Order tracker Pro
Where an order is, as Shop and Amazon show it: the arrival day up top ("Arriving tomorrow"), the status in a badge, a bar that fills to the step it has reached, the carrier with a copyable tracking number, and the carrier's scans under Tracking history. The bar is a progress bar for screen readers ("Step 3 of 4: Out for delivery").
import { OrderTracker } from '@patine-ui/pro';
<OrderTracker current="out" eta={tomorrow} orderNumber="#10482" carrier="UPS" trackingNumber="1Z999AA10123456784" events={scans} style={{ width: 420 }} />
Try the props
currentstatusorientationvariantdesign<OrderTracker
current="out"
eta={eta}
orderNumber="#10482"
carrier="UPS"
trackingNumber="1Z999AA10123456784"
events={scans}
current="out"
/>
Example: a delayed parcel
An order page when something went wrong: the carrier missed a scan, so the tracker shows the delay, the newest scans are open, and the actions offer the next useful step.
<View style={{ width: '100%', maxWidth: 440, gap: 8 }}> <OrderTracker current="shipped" status="delayed" eta={new Date(Date.now() + 2 * 86400000)} orderNumber="#20417" carrier="PostNL" trackingNumber="3SABC1234567890" events={SCANS} eventsOpen actions={ <View style={{ flexDirection: 'row', gap: 8, flexWrap: 'wrap' }}> <Button size="sm" variant="outline" onPress={() => setAsked(true)}> Deliver to a pickup point </Button> <Button size="sm" variant="ghost">Contact us</Button> </View> } /> {asked ? <Text size="sm" color="success">We asked PostNL to send it to your nearest pickup point.</Text> : null} </View>
Steps and status
The default steps are Ordered, Shipped, Out for delivery and Delivered; pass your own steps ({ key, label, description?, time?, icon? }). current is the reached step's key or index. status colors the bar and badge: 'active', 'delayed', 'exception', 'cancelled' or 'delivered' (the default once the last step is reached). deliveredAt turns the headline into "Delivered Mon, Mar 9".
<View style={{ gap: 16, width: 420 }}> <OrderTracker steps={steps} current="preparing" orderNumber="A-17" /> <OrderTracker current={1} status="delayed" eta={new Date(Date.now() + 3 * 86400000)} orderNumber="#10391" /> <OrderTracker current={3} deliveredAt={new Date(Date.now() - 86400000)} orderNumber="#10220" /> </View>
Down a line
orientation="vertical" draws the steps down a Timeline, each with its time, for a page of its own. variant="plain" drops the card.
<OrderTracker steps={steps} current="shipped" orientation="vertical" eta={new Date(Date.now() + 2 * 86400000)} actions={ <> <Button variant="outline" size="sm">Contact support</Button> <Button variant="ghost" size="sm">Return items</Button> </> } style={{ width: 380 }} />
Copying the tracking number
The copy button uses the browser's clipboard on the web. On iOS and Android pass your clipboard library's function: onCopyTracking={Clipboard.setStringAsync} from expo-clipboard. onTrackingPress makes the number a link to the carrier.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
current | string | number | — | The step reached, by key or index. |
steps | OrderStep[] | Ordered → Delivered | { key, label, description?, time?, icon? } |
status | 'active' | 'delayed' | 'exception' | 'cancelled' | 'delivered' | 'active' | |
orientation | 'horizontal' | 'vertical' | 'horizontal' | |
variant | 'card' | 'plain' | 'card' | |
orderNumber | string | — | |
eta / deliveredAt | Date | string | — | The headline. |
carrier / trackingNumber | string | — | |
onCopyTracking / onTrackingPress | |||
events | { id?, time, description, location? }[] | — | Tracking history, newest first. |
eventsOpen / defaultEventsOpen / onEventsOpenChange | boolean | false | |
actions | ReactNode | — | Buttons under the tracker. |
locale / hour12 / now | |||
loading / error / onRetry | States. | ||
density / animate / labels / design / theme / style |