Expandable Grid
Expandable grid for previewing clicked item.
Loading...
Installation
Usage
<ExpandableGrid>
{products.map((product, index) => (
<ExpandableGridCell key={product.id} index={index}>
<div className="size-full p-6">
<div className="relative aspect-square w-full max-w-full">
<Image
className="user-select-none select-none object-contain"
fill
alt="product"
src={product.imageUrl}
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw"
/>
</div>
</div>
</ExpandableGridCell>
))}
</ExpandableGrid>Props
ExpandableGrid
| Prop | Type | Default |
|---|---|---|
padding? | number | 24 |
transitionDuration? | number | 300ms |
expandScale? | number | 3 |
breakpoints? | [number, number][] | [1536, 10], [1280, 8], [1024, 6], [768, 4], [640, 2], [0, 1] |
ExpandableGridCell
| Prop | Type | Default |
|---|---|---|
index | number | - |