diff --git a/templates/hydrogen-theme/app/components/ProductCardGrid.tsx b/templates/hydrogen-theme/app/components/ProductCardGrid.tsx
index 555a165..d1d8641 100644
--- a/templates/hydrogen-theme/app/components/ProductCardGrid.tsx
+++ b/templates/hydrogen-theme/app/components/ProductCardGrid.tsx
@@ -1,14 +1,29 @@
+import type {CSSProperties} from 'react';
+import {cx} from 'class-variance-authority';
+
import type {ProductCardFragment} from 'storefrontapi.generated';
import {ProductCard} from './ProductCard';
-export function ProductCardGrid(props: {products: ProductCardFragment[]}) {
+export function ProductCardGrid(props: {
+ products: ProductCardFragment[];
+ columns?: number | null;
+}) {
const {products} = props;
+ const columnsVar = {
+ '--columns': props.columns ?? 3,
+ } as CSSProperties;
return products.length > 0 ? (
-
+
{products.map((product) => (
-
+
))}
diff --git a/templates/hydrogen-theme/app/components/sections/CollectionListSection.tsx b/templates/hydrogen-theme/app/components/sections/CollectionListSection.tsx
index 802ecd7..3a4ffba 100644
--- a/templates/hydrogen-theme/app/components/sections/CollectionListSection.tsx
+++ b/templates/hydrogen-theme/app/components/sections/CollectionListSection.tsx
@@ -1,10 +1,10 @@
import type {TypeFromSelection} from 'groqd';
+import {Suspense} from 'react';
+import {Await, useLoaderData} from '@remix-run/react';
import type {COLLECTION_LIST_SECTION_FRAGMENT} from '~/qroq/sections';
import type {loader as indexLoader} from '../../routes/_index';
import type {SectionDefaultProps} from '~/lib/type';
-import {Await, useLoaderData} from '@remix-run/react';
-import {Suspense} from 'react';
import {CollectionListGrid} from '../CollectionListGrid';
type CollectionListSectionProps = TypeFromSelection<
@@ -34,7 +34,10 @@ export function CollectionListSection(
return (
-
+
);
}}
diff --git a/templates/hydrogen-theme/app/components/sections/FeaturedCollectionSection.tsx b/templates/hydrogen-theme/app/components/sections/FeaturedCollectionSection.tsx
index df6389c..79e2795 100644
--- a/templates/hydrogen-theme/app/components/sections/FeaturedCollectionSection.tsx
+++ b/templates/hydrogen-theme/app/components/sections/FeaturedCollectionSection.tsx
@@ -1,12 +1,12 @@
import type {TypeFromSelection} from 'groqd';
import {Suspense} from 'react';
import {Await, useLoaderData} from '@remix-run/react';
+import {flattenConnection} from '@shopify/hydrogen';
import type {FEATURED_COLLECTION_SECTION_FRAGMENT} from '~/qroq/sections';
import type {loader as indexLoader} from '../../routes/_index';
import type {SectionDefaultProps} from '~/lib/type';
import {ProductCardGrid} from '../ProductCardGrid';
-import {flattenConnection} from '@shopify/hydrogen';
type FeaturedCollectionSectionProps = TypeFromSelection<
typeof FEATURED_COLLECTION_SECTION_FRAGMENT
@@ -38,7 +38,10 @@ export function FeaturedCollectionSection(