Cart Line Item
DisplayMITCart row with thumbnail, title, variant, price, quantity stepper, and remove action.
bun add @otfdashkit/ui
Preview
Cart Line ItemDisplay
Loading Storybook preview…
Code
@otfdashkit/uiimport { useState } from 'react'
import { CartLineItem } from '@otfdashkit/ui'
const IMG = 'https://images.unsplash.com/photo-1559056199-641a0ac8b55e?q=80&w=200&auto=format&fit=crop'
export function Example() {
const [qty, setQty] = useState(2)
return (
<div className="w-[480px]">
<CartLineItem
image={IMG}
title="Sunrise Blend"
variant="Whole bean · 250g"
price={1800}
quantity={qty}
onQuantityChange={setQty}
onRemove={() => {}}
/>
</div>
)
}
Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.
Kit for this component
Marketplace Kit$99
Build a cart or checkout list with a line for each item.
Props
Props declared in the CartLineItem source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| pricerequired | number | Unit price in minor units (cents). | |
| quantityrequired | number | ||
| titlerequired | string | ||
| compareAt | number | Optional compare-at unit price in minor units. | |
| currency | string | 'USD' | |
| image | string | Product thumbnail URL. | |
| maxQuantity | number | 99 | |
| minQuantity | number | 1 | |
| onQuantityChange | (qty: number) => void | ||
| onRemove | () => void | ||
| variant | string | Variant summary line, e.g. "Whole bean · 250g". |