WebberUI

Product Quick View

A product card that opens a quick view dialog — image switching, variant selection, and add to cart.

This is a WebberUI Pro component

Free during the launch campaign: sign up or sign in, then hit “Copy install command” in the preview above and it installs straight away — no payment, no credit card. The command below returns 401 while you are signed out.

How to install Pro components →See the plans →

Hovering a product card reveals a quick view button; clicking it morphs the card open into a centered dialog through layoutId, with a thumbnail gallery on the left and color swatches, size selection, and a quantity stepper on the right. After adding to cart, the button transforms into success feedback — a good fit for shortening the path to purchase from an e-commerce listing page.

Loading preview…
npx shadcn@latest add "https://webberui.com/r/product-quick-view.json?t=<install token>"

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

<ProductQuickView />

Installation

npx shadcn@latest add "https://webberui.com/r/product-quick-view.json?t=<install token>"

Or, once registries are configured in components.json, install it as @webberui/product-quick-view.

Usage

import { ProductQuickView } from "@/components/ui/product-quick-view";

<ProductQuickView
  product={{
    name: "Lightweight knit running shoe",
    price: 2680,
    originalPrice: 3280,
    rating: 4.5,
    badge: "New",
    emoji: "👟",
    colors: [
      { name: "Misty blue", hue: 210 },
      { name: "Coral", hue: 16 },
    ],
    sizes: ["US 8", "US 9", "US 10"],
  }}
  onAddToCart={({ color, size, quantity }) => {
    console.log(color, size, quantity);
  }}
/>

Props

PropTypeDefaultDescription
productQuickViewProductProduct data (see the table below)
onAddToCart(selection: { color: string; size: string; quantity: number }) => voidAdd-to-cart callback, returning the selected color, size, and quantity
classNamestringForwarded to the card's outer container

QuickViewProduct fields:

FieldTypeDefaultDescription
namestringProduct name
pricenumberSelling price (in New Taiwan dollars)
originalPricenumberStruck-through original price; when provided, the discount percentage is shown
descriptionstringShort product description, shown below the price in the dialog
ratingnumberStar rating (0–5)
badgestringTag text in the corner of the card, for example "New"
emojistring"🛍️"Emoji icon in the center of the placeholder product image
colors{ name: string; hue: number }[]List of selectable colors; hue generates the swatches and the gradient placeholder image
sizesstring[]List of selectable sizes

Accessibility

  • The dialog uses role="dialog" with aria-modal, the close button is focused automatically on open, and it can be closed with Esc or by clicking the overlay
  • The quick view button also appears on keyboard focus-visible, so it does not depend on mouse hover
  • The swatch, size, and thumbnail buttons all have aria-labels or readable text, and mark their selected state with aria-pressed
  • Quantity and add-to-cart state changes are announced through aria-live="polite"
  • When the user has "reduce motion" enabled at the system level, the morph expand animation is disabled in favor of a plain fade in and fade out

On this page