Free block
Commerce / Product quick view
Product quick view / Studio collection
Product quick view composition with studio layout and working local controls.
"use client";
import { useState } from "react";
import {
Badge,
Button,
Card,
Image,
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from "@pimolu/react";
export function StudioProductQuickViewBlock() {
const [message, setMessage] = useState("");
const products = [
{
id: "studio",
name: "Studio Headphones",
price: 129,
image: "/images/pimolu-studio.webp",
category: "Audio",
},
{
id: "orbit",
name: "Orbit Art Print",
price: 39,
image: "/images/pimolu-atmosphere.webp",
category: "Art",
},
{
id: "edition",
name: "Studio Limited",
price: 159,
image: "/images/pimolu-studio.webp",
category: "Audio",
},
];
const [selected, setSelected] = useState(products[0]);
const [open, setOpen] = useState(false);
return (
<section className="mx-auto max-w-6xl space-y-8 p-5 sm:p-10">
<header>
<h2 className="text-2xl font-semibold tracking-tight sm:text-3xl">
Product quick view
</h2>
</header>
<div className="grid gap-5 md:grid-cols-3">
{products.map((p) => (
<Card key={p.id} className="space-y-4 p-4">
<Image
src={p.image}
alt={p.name + " illustrative artwork"}
aspectRatio="4 / 3"
containerStyle={{
width: "100%",
}}
/>
<h3 className="text-xl">{p.name}</h3>
<Button
appearance="outline"
onClick={(e) => {
e.currentTarget.focus();
setSelected(p);
setOpen(true);
}}
>
Quick view {p.name}
</Button>
</Card>
))}
</div>
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent>
<DialogHeader>
<DialogTitle>{selected.name}</DialogTitle>
</DialogHeader>
<div className="grid gap-5 sm:grid-cols-2">
<Image
src={selected.image}
alt={selected.name + " illustrative artwork"}
aspectRatio="4 / 3"
containerStyle={{
width: "100%",
}}
/>
<div className="space-y-4">
<Badge>{selected.category}</Badge>
<p className="text-2xl">{"$" + selected.price}</p>
<p className="text-muted">
A balanced frame and soft cushions for your listening space.
</p>
<Button
onClick={() => {
setMessage(selected.name + " added locally.");
setOpen(false);
}}
>
Add selected product
</Button>
</div>
</div>
</DialogContent>
</Dialog>
<p role="status" className={message ? "text-sm text-muted" : "sr-only"}>
{message}
</p>
</section>
);
}Make it part of your product.
This is the source used by the preview, with Pimolu components and Tailwind layout utilities. Load the shared Pimolu stylesheet and your own Tailwind setup. Replace sample destinations with your routes. Form and billing previews use local sample state; connect your own application services.
Built with Badge · Button · Card · Image · Dialog · DialogContent · DialogHeader · DialogTitle
Download the Pimolu demo artwork into public/images/pimolu-studio.webp, or replace it with your product photograph.
Download the Pimolu landscape artwork into public/images/pimolu-atmosphere.webp, or use your own illustration.