DS0
Components

Cart

A shopping cart display with item list, quantity controls, total, and checkout.

Overview

Cart provides a shopping cart experience with line items, quantity adjustments, subtotal calculations, and checkout action. Use as a page section, drawer panel, or standalone view.

Cart

4
Wireless Headphones

Wireless Headphones

$79.99 × 1

1
$79.99
Mechanical Keyboard

Mechanical Keyboard

$149.99 × 2

2
$299.98
USB-C Hub

USB-C Hub

$34.99 × 1

1
$34.99
Total$414.96

Usage

<Cart
  items={cartItems}
  onUpdateQuantity={handleQuantity}
  onRemove={handleRemove}
  onCheckout={handleCheckout}
/>

API Reference

PropTypeDefaultDescription
itemsCartItem[][]Cart line items
onUpdateQuantity(id: string, qty: number) => voidQuantity change handler
onRemove(id: string) => voidRemove item handler
onCheckout() => voidCheckout button handler
currencystring'USD'Currency for formatting
ComponentWhen to Use Instead
ProductCardIndividual product display
PricingTableComparing pricing tiers
DataTableGeneric tabular data

On this page