Back to blocks
BlockeCommerceFree

Your Cart Page React component

A three-step eCommerce flow in one block: a cart with quantity steppers and promo code, a checkout form with an order summary, and an animated order-confirmed screen.

About the Your Cart Page component

Your Cart Page is a free three-step checkout flow in one component: a cart with quantity steppers, remove buttons, a promo code field and a totals panel; a contact, shipping and payment form next to an order summary; and an Order Confirmed screen with a check mark that draws itself in. A progress bar at the top shows Step 1 of 3 and moves as you go.

Subtotal, a 10% promo discount (codes in promoCodes, matched case-insensitively), flat shippingAmount and tax at taxRate are calculated from the digits in each item's price and shown with your currency symbol. Pay Now calls onPay with the items, amounts and form values; the component doesn't validate the form or charge a card itself. Steps change with a blur, slide, fade or scale animation (animation, animationDuration) that is switched off under prefers-reduced-motion, form fields carry autocomplete hints, and the layout goes to two columns when its container is 920px wide or more.

When to use it

Use it as the cart and checkout screens of a storefront prototype, a headless commerce front end or a single-product shop, wiring onPay to your payment provider.

For the product page that feeds the cart, use Product Detail; for card number formatting on its own, use Credit Card Input.

Installation

Add the Your Cart Page component to your project with the shadcn CLI. It lands in components/your-cart-page.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/your-cart-page

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install motion clsx tailwind-merge

Related components

SEO-ready
Product List
Free
Hero Slider Carousel
SEO-ready
Product Detail
Free
Product Highlight Block
Free
SEO-ready
Review Marquee Wall
SEO-ready
Testimonial Reviews