Ballmac UI home

Ecommerce 2: product page

A product page that closes the sale: a gallery you step through with arrow keys, price and rating, named color and option choices, a quantity stepper, an add-to-bag button that reports back, fine print one tap away, and reviews.

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

Usage

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

import { Ecommerce2 } from "@/components/ballmac/blocks/ecommerce-2/ecommerce-2"

export default function Ecommerce2Demo() {
  return <Ecommerce2 />
}

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 gallery and details under the page, announced as loading.

    state="loading"
  • No longer available

    Says the product is no longer available; emptyState sets the copy.

    state="empty"
  • Could not load

    An alert saying nothing was changed, with Try again (onRetry). Adding to the bag that fails says why under the button.

    state="error"

Dependencies

Use with AI

Product page. <Ecommerce2 product={{ name, price, compareAt?, summary, kind, colors, option?: { label, values: [{ id, label, available? }] }, details: [{ title, body }], highlights, counts, reviews }} currency onAddToBag={({ color, option, quantity }) => Promise} />. Choosing a color changes the picture; unavailable options are disabled and marked sold out; the total on the button follows the quantity. Details are native disclosure elements. With the shadcn MCP server set up (guide), ask your agent:

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

Use it for

  • The page a buyer reads before they buy
  • Any single product with options

Not for

  • Listing many products; use ecommerce-1
  • A pricing table for software; use pricing-2

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