Ballmac UI home

Ecommerce 3: shopping bag

A shopping bag that is hard to get wrong: quantities change at once and go back with the reason, removing leaves an Undo, a promo code says why it failed, and a bar shows how far you are from free shipping.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/ecommerce-3

Usage

Example: ecommerce-3-demo.tsx
"use client"

import { Ecommerce3 } from "@/components/ballmac/blocks/ecommerce-3/ecommerce-3"

export default function Ecommerce3Demo() {
  return <Ecommerce3 />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton lines and summary under the real heading, announced as loading.

    state="loading"
  • Your bag is empty

    Says the bag is empty; emptyState sets the copy.

    state="empty"
  • Could not load

    An alert saying nothing was changed, with Try again (onRetry). A quantity, remove or promo code that fails says why and changes nothing.

    state="error"

Dependencies

Use with AI

Shopping bag. <Ecommerce3 title lines={[{ id, name, variant, price, quantity, kind, tone, max? }]} currency freeShippingFrom shippingCost onChangeQuantity={(id, q) => Promise} onRemove={(id) => Promise} onApplyPromo={(code) => Promise<{ code, label, amount }>} onCheckout undoMs />. Quantity changes are optimistic and revert with the reason if they reject; Remove waits undoMs (default 5000) so Undo works; a rejected promo shows its message next to the field. Without onApplyPromo the demo code WELCOME10 works. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Ecommerce 3: shopping bag (@ballmac/ecommerce-3) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The page between a product and a checkout
  • A mini-cart screen in an app

Not for

  • Paying; use ecommerce-4
  • Listing items for sale; use ecommerce-1

Registry JSON: https://ui.ballmac.com/r/ecommerce-3.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.