Ballmac UI home

Ecommerce 4: checkout

A three-step checkout on one page: contact, delivery, payment. Finished steps fold into a summary with Edit, mistakes are named beside their field with focus on the first, and a declined card says so and charges nothing.

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-4

Usage

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

import { Ecommerce4 } from "@/components/ballmac/blocks/ecommerce-4/ecommerce-4"

export default function Ecommerce4Demo() {
  return <Ecommerce4 />
}

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 steps 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 charged, with Try again (onRetry). A payment that fails shows the reason above the card fields and charges nothing.

    state="error"

Dependencies

Use with AI

Checkout. <Ecommerce4 title lines methods={[{ id, label, detail, price }]} currency onPlaceOrder={(order) => Promise<string | void>} />. Steps open one at a time and validate on Continue; errors appear next to the field (aria-invalid, aria-describedby) and focus moves to the first. The card number uses a checksum; expiry is checked against today. onPlaceOrder resolves with an order number or rejects with the reason, which is shown as an alert. The sample accepts 4242 4242 4242 4242. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • The last screen before payment in a shop
  • A checkout you want to feel calm and honest

Not for

  • Subscriptions and plan changes; use billing-1
  • A shopping bag; use ecommerce-3

Registry JSON: https://ui.ballmac.com/r/ecommerce-4.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.