# XWUICartDrawer

A slide-out mini-cart summary: line items with thumbnail, name, variant, unit price and a quantity stepper; a remove button per row; an optional free-shipping progress hint (`config.freeShippingThreshold`); a subtotal row; and "Checkout" / "Continue shopping" actions. The checkout button disables itself when the cart is empty.

## Events

| Event | Callback | Subscriber | `detail` |
|---|---|---|---|
| `xwui-cart-drawer:quantity-change` | `onQuantityChange` | `onQuantityChange(handler)` | `{ itemId, quantity }` |
| `xwui-cart-drawer:remove-item` | `onRemoveItem` | `onRemoveItem(handler)` | `{ itemId }` |
| `xwui-cart-drawer:checkout` | `onCheckout` | `onCheckout(handler)` | `{ subtotal }` |
| `xwui-cart-drawer:continue-shopping` | `onContinueShopping` | — | — |

## Usage

```ts
import { XWUICartDrawer } from '@exonware/xwui/industry';

const drawer = new XWUICartDrawer(host, {
  items: [
    { id: 'i1', name: 'Wireless Earbuds', unitPrice: 79, quantity: 1 },
  ],
}, { currency: 'USD', freeShippingThreshold: 150 });

drawer.onCheckout((subtotal) => api.startCheckout(subtotal));
```

```api
```
