CartLine
One line of a cart or an order.
- Al pastor trioFlour · Habanero mango · Guacamole$14.25
- Horchata$8.00
View code
<ul>
{cart.lines.map((line, index) => (
<CartLine
name={line.name}
details={line.picks.join(" · ")}
price={formatAmount(line.total, "USD")}
media={<img src={line.picture} alt="" />}
action={<QuantityStepper action="/cart/line" value={line.qty} fields={{ line: String(index) }} labels={labels(line)} />}
/>
))}
</ul>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { CartLine } from "@sdxc/ui/commerce";Renders the line inside a list the caller draws.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
name | RemixNode | Yes | |
details | RemixNode | No | The picks, such as "Blue corn · Guacamole". |
price | RemixNode | Yes | The line's price as the reader sees it. |
media | RemixNode | No | |
mediaBackground | string | No | The colour behind the picture. |
action | RemixNode | No | A control at the end, such as a QuantityStepper. |
Also accepts everything in Omit<TagProps<"li">, "children">.