DDBS UI
product

Product Info

The information column of a product page: eyebrow, title, price with rating, description, and slots for options, actions, perks and a details block.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/product-info.json
Fullscreen

Linen collection

Lounge chair

A low, deep seat in solid oak

2,890 MAD2,490 MAD

4.6 (38 reviews)

Made in small runs in Casablanca. The frame is joined without screws and finished with a hard wax oil.

Finish: Natural oak

Quantity

1
  • Delivered in 3 to 6 days to Casablanca and Rabat.
  • Five year frame warranty.

Usage

product-info-example.tsx
"use client";

import { useState } from "react";
import { Truck, ShieldCheck } from "lucide-react";
import { OptionChooser, ProductInfo, QuantityStepper } from "@dbs/ui";

export default function ProductInfoExample() {
  const [finish, setFinish] = useState("oak");
  const [q, setQ] = useState(1);
  return (
    <div className="w-full max-w-lg">
      <ProductInfo
        sticky={false}
        eyebrow="Linen collection"
        title="Lounge chair"
        subtitle="A low, deep seat in solid oak"
        price="2,490 MAD"
        oldPrice="2,890 MAD"
        rating={{ value: 4.6, count: 38 }}
        description="Made in small runs in Casablanca. The frame is joined without screws and finished with a hard wax oil."
        actions={
          <div className="flex items-center gap-4">
            <QuantityStepper value={q} onChange={setQ} />
            <button type="button" className="h-[52px] flex-1 rounded-full bg-ink text-[15px] font-semibold text-canvas">Add to cart</button>
          </div>
        }
        perks={[
          { icon: <Truck />, content: <><strong className="font-medium text-ink">Delivered in 3 to 6 days</strong> to Casablanca and Rabat.</> },
          { icon: <ShieldCheck />, content: "Five year frame warranty." },
        ]}
      >
        <OptionChooser
          label="Finish"
          valueLabel={finish === "oak" ? "Natural oak" : "Walnut"}
          value={finish}
          onChange={setFinish}
          options={[
            { id: "oak", label: "Natural oak", hint: "Included", swatch: "#c9a574" },
            { id: "walnut", label: "Walnut", hint: "+200 MAD", swatch: "#5b3a29" },
          ]}
        />
      </ProductInfo>
    </div>
  );
}