E-commerce
CartDrawer
Slide-out cart panel with quantity controls, item removal, and subtotal.
Quick Preview
Installation
npm install lucide-react
Features
- Slide-in overlay
- Quantity controls
- Remove items
- Subtotal
- Empty state
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | CartItem[] | - | Cart items (uses defaults if omitted) |
open | boolean | - | Controlled open state |
onOpenChange | (open: boolean) => void | - | Open state handler |
onCheckout | () => void | - | Checkout button callback |
currency | string | '$' | Currency symbol |
className | string | - | Trigger button CSS classes |