Cart Line Item

React shopping cart row with product title, unit price, a quantity stepper and an optional remove button. Callbacks report quantity changes and removals.

src/registry/ui/cart-line-item.tsx/r/cart-line-item.json

Installation#

bash
npx shadcn@latest add @minidev/cart-line-item

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/cart-line-item.json

Usage#

tsx
import { CartLineItem } from "@/components/ui/cart-line-item"

export function Example() {
  return (
    <CartLineItem title="Studio seat" price="$49.00" quantity={qty} onQuantityChange={setQty} onRemove={() => {}} />
  )
}

API reference#

CartLineItem props
PropTypeDefault
title*string-
price*string-
quantity*number-
onQuantityChange(n: number) => void-
onRemove() => void-
classNamestring-

* required

Dependencies#

npm

lucide-react

Examples#

All e-commerce components