SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

CartLine

One line of a cart or an order.

  • Al pastor trioFlour · Habanero mango · Guacamole$14.25
    1
  • Horchata$8.00
    2
View code
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

PropTypeRequiredDescription
nameRemixNodeYes
detailsRemixNodeNoThe picks, such as "Blue corn · Guacamole".
priceRemixNodeYesThe line's price as the reader sees it.
mediaRemixNodeNo
mediaBackgroundstringNoThe colour behind the picture.
actionRemixNodeNoA control at the end, such as a QuantityStepper.

Also accepts everything in Omit<TagProps<"li">, "children">.

@sdxc/ui

Can’t find it? Contact us