Component
ItemSummary
Quantity and money stay visible and editable until confirm.
Rows, a quantity stepper, and a subtotal. Also exported as the Cart alias in A2UI messages.
Plan
Group fare to Lisbon
Per seat, mid May
12€3,720
Rooms in Alfama
Per room, 4 nights
6€5,040
Group dinner
Per person
12€660
Subtotal
€9,420
Do
- Keep quantity editable until the person confirms.
- Show the subtotal in the same surface.
- Leave a removed line visible, at zero.
Don't
- Lock the plan before it has been reviewed.
- Round away a number the person needs.
- Start a second checkout somewhere else on the page.
Props
| Prop | Type | Description |
|---|---|---|
| items | SummaryItem[] | Name, detail, quantity, and unit price. |
| currency | string | ISO currency. Defaults to EUR. |
| onQuantityChange | (id, quantity) => void | Stepper callback. Zero removes the line from the subtotal. |
A2UI message
v0.9.1 envelope. catalogId is latch://catalog/v1. The preview under the message is rendered by the adapter, not hand-built.
JSON
[
{
"version": "v0.9.1",
"createSurface": {
"surfaceId": "plan",
"catalogId": "latch://catalog/v1"
}
},
{
"version": "v0.9.1",
"updateDataModel": {
"surfaceId": "plan",
"path": "/dinner",
"value": 55
}
},
{
"version": "v0.9.1",
"updateComponents": {
"surfaceId": "plan",
"components": [
{
"id": "root",
"component": "ItemSummary",
"currency": "EUR",
"items": [
{
"id": "flights",
"name": "Group fare to Lisbon",
"detail": "Per seat",
"quantity": 12,
"unitPrice": 310
},
{
"id": "rooms",
"name": "Rooms in Alfama",
"detail": "Per room, 4 nights",
"quantity": 6,
"unitPrice": 840
},
{
"id": "dinner",
"name": "Group dinner",
"detail": "Per person",
"quantity": 12,
"unitPrice": {
"path": "/dinner"
}
}
]
}
]
}
}
]Plan
Group fare to Lisbon
Per seat
12€3,720
Rooms in Alfama
Per room, 4 nights
6€5,040
Group dinner
Per person
12€660
Subtotal
€9,420