Open History to see the last commit
1import { Link, createFileRoute } from "@tanstack/react-router";
2import products from "@/data/products";
3
4export const Route = createFileRoute("/")({
5 component: ProductsIndex,
6});
7
8function ProductsIndex() {
9 const [featured, ...catalog] = products;
10
11 return (
12 <main className="page-wrap px-4 pb-8 pt-14">
13 <section className="island-shell rise-in relative overflow-hidden rounded-[2rem] px-6 py-10 sm:px-10 sm:py-14">
14 <div className="pointer-events-none absolute -left-20 -top-24 h-56 w-56 rounded-full bg-[radial-gradient(circle,rgba(79,184,178,0.32),transparent_66%)]" />
15 <div className="pointer-events-none absolute -bottom-20 -right-20 h-56 w-56 rounded-full bg-[radial-gradient(circle,rgba(47,106,74,0.18),transparent_66%)]" />
16 <p className="island-kicker mb-3">TanStack Ecommerce Template</p>
17 <h1 className="display-title mb-5 max-w-3xl text-4xl leading-[1.02] font-bold tracking-tight text-[var(--sea-ink)] sm:text-6xl">
18 The TanStack Storefront.
19 </h1>
20 <p className="mb-8 max-w-2xl text-base text-[var(--sea-ink-soft)] sm:text-lg">
21 A polished ecommerce landing page for teams shipping with Start,
22 Router, Query, Form, and friends. Same laid-back vibe as the blog
23 template, but tuned for product catalogs and conversion flows.
24 </p>
25 <div className="flex flex-wrap gap-3">
26 <a
27 href="#products"
28 className="rounded-full border border-[rgba(50,143,151,0.3)] bg-[rgba(79,184,178,0.14)] px-5 py-2.5 text-sm font-semibold text-[var(--lagoon-deep)] no-underline transition hover:-translate-y-0.5 hover:bg-[rgba(79,184,178,0.24)]"
29 >
30 Browse Catalog
31 </a>
32 <Link
33 to="/products/$productId"
34 params={{ productId: String(featured.id) }}
35 className="rounded-full border border-[var(--soft-btn-border)] bg-[var(--soft-btn-bg)] px-5 py-2.5 text-sm font-semibold text-[var(--sea-ink)] no-underline transition hover:-translate-y-0.5 hover:border-[var(--soft-btn-border-hover)]"
36 >
37 View Featured
38 </Link>
39 </div>
40 </section>
41
42 <section className="mt-8 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
43 <article className="island-shell rise-in rounded-2xl p-5 sm:p-6 lg:col-span-2">
44 <img
45 src={featured.image}
46 alt={featured.name}
47 className="mb-4 h-44 w-full rounded-xl object-cover xl:h-60"
48 />
49 <h2 className="m-0 text-2xl font-semibold text-[var(--sea-ink)]">
50 <Link
51 to="/products/$productId"
52 params={{ productId: String(featured.id) }}
53 className="no-underline"
54 >
55 {featured.name}
56 </Link>
57 </h2>
58 <p className="mb-2 mt-3 text-base text-[var(--sea-ink-soft)]">
59 {featured.description}
60 </p>
61 <p className="m-0 text-sm font-semibold text-[var(--lagoon-deep)]">
62 ${featured.price.toLocaleString()}
63 </p>
64 </article>
65
66 {catalog.map((product, index) => (
67 <article
68 key={product.id}
69 className="island-shell rise-in rounded-2xl p-5"
70 style={{ animationDelay: `${index * 80 + 120}ms` }}
71 >
72 <img
73 src={product.image}
74 alt={product.name}
75 className="mb-4 h-44 w-full rounded-xl object-cover"
76 />
77 <h2 className="m-0 text-2xl font-semibold text-[var(--sea-ink)]">
78 <Link
79 to="/products/$productId"
80 params={{ productId: String(product.id) }}
81 className="no-underline"
82 >
83 {product.name}
84 </Link>
85 </h2>
86 <p className="mb-2 mt-2 text-sm text-[var(--sea-ink-soft)]">
87 {product.shortDescription}
88 </p>
89 <p className="m-0 text-xs font-semibold tracking-[0.12em] text-[var(--kicker)] uppercase">
90 {product.category}
91 </p>
92 <p className="mt-2 text-sm font-semibold text-[var(--lagoon-deep)]">
93 ${product.price.toLocaleString()}
94 </p>
95 </article>
96 ))}
97 </section>
98
99 <section id="products" className="island-shell mt-8 rounded-2xl p-6">
100 <p className="island-kicker mb-2">Why This Template</p>
101 <ul className="m-0 list-disc space-y-2 pl-5 text-sm text-[var(--sea-ink-soft)]">
102 <li>Product-first landing page and detail flow with clean file routes.</li>
103 <li>Optional AI assistant support preserved for demos and experimentation.</li>
104 <li>Theme tokens match the same design language as the blog/base templates.</li>
105 </ul>
106 </section>
107 </main>
108 );
109}