DDBS UI
collections

Collection Mosaic

Collection or category tiles in three layouts: a four-tile mosaic, text-left cut-out tiles, and photo tiles with the title on top.

npx shadcn@latest add https://ui.develop-better-solutions.com/r/collection-mosaic.json
Dependencies:lucide-react

Usage

collection-mosaic-example.tsx
import { CollectionMosaic, type CollectionTileData } from "@dbs/ui";

const TILES: CollectionTileData[] = [
  { id: "a", title: "Work from home", meta: "24 pieces", cta: "Shop now", href: "#", image: "/samples/steps-boxes.jpg", alt: "Desk collection" },
  { id: "b", title: "Lounge", meta: "18 pieces", cta: "Shop now", href: "#", image: "/samples/approach-glass.jpg", alt: "Lounge collection" },
  { id: "c", title: "Lighting", meta: "31 pieces", cta: "Shop now", href: "#", image: "/samples/torus.png", alt: "Lighting collection", badge: "-20%" },
  { id: "d", title: "Sofas", meta: "12 pieces", cta: "Shop now", href: "#", image: "/samples/steps-boxes.jpg", alt: "Sofa collection" },
];

export default function CollectionMosaicExample() {
  return (
    <div className="flex w-full flex-col gap-10 py-6">
      <CollectionMosaic variant="mosaic" tiles={TILES} />
      <CollectionMosaic variant="split" tiles={TILES.slice(0, 3).map((t) => ({ ...t, title: t.title, meta: "Cut-out pieces for small rooms.", cta: "View collection" }))} />
      <CollectionMosaic variant="photo" tiles={TILES.map((t) => ({ ...t, cta: "Explore" }))} />
    </div>
  );
}