Image Grid

Usage pattern

Important

The ImageGrid component is designed to have content slotted inside it. This flexibility allows for usage in MDX as well as declarative component usage.

Responsive syntax

The columns and span props accept an object, a positional array, or a single value.

{/* Object form */}
<ImageGrid columns={{ mobile: 2, tablet: 3 }} space="small" span={{ mobile: 2, tablet: 'full' }}>
{/* Array form - positional shorthand: [mobile, tablet, desktop] */}
<ImageGrid columns={[2, 3]} space="small" span={[2, 'full']}>
{/* Single value - same at all breakpoints */}
<ImageGrid columns={3} space="small">

MDX usage

In MDX, markdown image syntax works directly as slot content alongside nested grids and video. Demonstrates responsive columns, fixed span, responsive span, and video.

<ImageGrid columns={[2, 3]} space="x-small">
<ImageGrid columns={2} space="x-small" span="full">
![](../../../content/article/2025/images/year-in-review/img-7456.jpeg)
![](../../../content/article/2025/images/year-in-review/img-7460.jpeg)
</ImageGrid>
![](../../../content/article/2025/images/year-in-review/img-7467.jpeg)
![](../../../content/article/2025/images/year-in-review/img-7462.jpeg)
![](../../../content/article/2025/images/year-in-review/img-7457.jpeg)
![](../../../content/article/2025/images/year-in-review/img-7468.jpeg)
![](../../../content/article/2025/images/year-in-review/img-7473.jpeg)
![](../../../content/article/2025/images/year-in-review/img-7477.jpeg)
<ImageGrid columns={1} space="x-small" span="full">
<video controls loop autoplay muted>
<source src="https://video.lloydatkinson.net/video-7614.mp4" type="video/mp4" />
</video>
</ImageGrid>
</ImageGrid>

Component usage

Using the Image component from astro:assets as slot content with the same nesting and span capabilities.

<ImageGrid
columns={{ mobile: 2, tablet: 3 }}
space="x-small">
<ImageGrid
columns={2}
space="x-small"
span="full">
<Image
src={photo1}
alt=""
width={600}
/>
<Image
src={photo2}
alt=""
width={600}
/>
</ImageGrid>
<Image
src={photo3}
alt=""
width={600}
/>
<Image
src={photo4}
alt=""
width={600}
/>
<Image
src={photo5}
alt=""
width={600}
/>
<Image
src={photo6}
alt=""
width={600}
/>
<Image
src={photo7}
alt=""
width={600}
/>
<Image
src={photo8}
alt=""
width={600}
/>
<ImageGrid
columns={1}
space="x-small"
span="full">
<video
controls
loop
autoplay
muted>
<source
src="https://video.lloydatkinson.net/video-7614.mp4"
type="video/mp4"
/>
</video>
</ImageGrid>
</ImageGrid>