Shopping cartPro
Cart with quantity steppers, remove with undo and free-shipping progress.
What's inside
- Quantity steppers
- Remove with undo
- Free-shipping progress
- Rolling subtotal
When to use
- Cart pages and drawers in stores.
When not to use
- Single-product purchases: go straight to checkout.
Installation
Usage
Import it from @/components/blocks/shopping-cart after installing. It ships with sample data, so it renders straight away; swap in your own data when you're ready.
import { ShoppingCart } from "@/components/blocks/shopping-cart";
export default function Page() {
return (
<main className="mx-auto max-w-6xl p-6">
<ShoppingCart />
</main>
);
}API reference
ShoppingCart
A cart with quantity steppers, remove with undo, a free-shipping progress bar and a rolling subtotal. Also the default export. No props: sample data sits at the top of the file, ready to swap for your own.
No props.
Keyboard interactions
| Keys | Action |
|---|---|
| Tab | Move through steppers and remove buttons |
| EnterorSpace | Change quantity or remove |
Accessibility
- Steppers are labelled per product; the free-shipping bar is a progressbar.
- Item count and undo are announced.
Motion
- Quantities roll; removed rows slide out and others close the gap; the shipping bar fills.
Responsive behavior
- Remove shows as an icon on phones.
Performance
- Sample data is plain arrays at the top of the file. Replace them with your API data and keep the shapes.
Notes for AI
- Undo keeps the item for 5 seconds; persist removals after that.
This page as Markdown, for assistants and coding agents:
/blocks/shopping-cart/markdownThe full library index for assistants is at /llms.txt.
Lode222 doc pagesllms.txt