Layout

FourColumnContainer

A pre-built layout wrapper for four equal columns. Perfect for feature grids, card layouts, or icon showcases.

Basic Examples

1. Basic Four Column Layout

Column 1

First column

Column 2

Second column

Column 3

Third column

Column 4

Fourth column

basic-four-column-layout
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
---

<FourColumnContainer
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-8' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left" class="bg-primary text-background p-6 rounded text-center">
    <p class="font-semibold">Column 1</p>
    <p>First column</p>
  </div>
  <div slot="centerLeft" class="bg-success text-background p-6 rounded text-center">
    <p class="font-semibold">Column 2</p>
    <p>Second column</p>
  </div>
  <div slot="centerRight" class="bg-secondary text-background p-6 rounded text-center">
    <p class="font-semibold">Column 3</p>
    <p>Third column</p>
  </div>
  <div slot="right" class="bg-accent text-background p-6 rounded text-center">
    <p class="font-semibold">Column 4</p>
    <p>Fourth column</p>
  </div>
</FourColumnContainer>

2. Feature Icons

🚀

Fast

Lightning speed performance

🔒

Secure

Enterprise-grade security

💡

Smart

Intelligent automation

🌍

Global

Worldwide coverage

feature-icons
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
---

<FourColumnContainer
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  gap="loose"
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left" class="text-center">
    <div class="text-5xl mb-4">🚀</div>
    <p class="font-semibold">Fast</p>
    <p class="text-sm">Lightning speed performance</p>
  </div>
  <div slot="centerLeft" class="text-center">
    <div class="text-5xl mb-4">🔒</div>
    <p class="font-semibold">Secure</p>
    <p class="text-sm">Enterprise-grade security</p>
  </div>
  <div slot="centerRight" class="text-center">
    <div class="text-5xl mb-4">💡</div>
    <p class="font-semibold">Smart</p>
    <p class="text-sm">Intelligent automation</p>
  </div>
  <div slot="right" class="text-center">
    <div class="text-5xl mb-4">🌍</div>
    <p class="font-semibold">Global</p>
    <p class="text-sm">Worldwide coverage</p>
  </div>
</FourColumnContainer>

3. With Background Color

Step 1

Sign up for free

Step 2

Choose your plan

Step 3

Start building

Step 4

Deploy & scale

with-background-color
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
---

<FourColumnContainer
  containerWidthType="full"
  background={{ class: 'bg-elevated' }}
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left" class="bg-surface p-6 rounded">
    <p class="font-semibold">Step 1</p>
    <p class="text-sm">Sign up for free</p>
  </div>
  <div slot="centerLeft" class="bg-surface p-6 rounded">
    <p class="font-semibold">Step 2</p>
    <p class="text-sm">Choose your plan</p>
  </div>
  <div slot="centerRight" class="bg-surface p-6 rounded">
    <p class="font-semibold">Step 3</p>
    <p class="text-sm">Start building</p>
  </div>
  <div slot="right" class="bg-surface p-6 rounded">
    <p class="font-semibold">Step 4</p>
    <p class="text-sm">Deploy & scale</p>
  </div>
</FourColumnContainer>

4. Responsive (Stacks on Mobile)

Mobile

Tablet

Desktop

4K

responsive-stacks-on-mobile
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
---

<FourColumnContainer
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-8' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  responsive={true}
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left" class="bg-error text-background p-6 rounded text-center">
    <p class="font-semibold">Mobile</p>
  </div>
  <div slot="centerLeft" class="bg-accent text-background p-6 rounded text-center">
    <p class="font-semibold">Tablet</p>
  </div>
  <div slot="centerRight" class="bg-warning text-background p-6 rounded text-center">
    <p class="font-semibold">Desktop</p>
  </div>
  <div slot="right" class="bg-success text-background p-6 rounded text-center">
    <p class="font-semibold">4K</p>
  </div>
</FourColumnContainer>

Practical Use Cases

5. Statistics Dashboard

1.2M

Active Users

98%

Satisfaction Rate

24/7

Support Available

150+

Countries

statistics-dashboard
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
---

<FourColumnContainer
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  gap="normal"
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left" class="bg-primary/10 p-6 rounded-lg border-2 border-primary/30">
    <div class="text-3xl font-bold text-primary mb-2">1.2M</div>
    <p class="text-normal">Active Users</p>
  </div>
  <div slot="centerLeft" class="bg-success/10 p-6 rounded-lg border-2 border-success/30">
    <div class="text-3xl font-bold text-success mb-2">98%</div>
    <p class="text-normal">Satisfaction Rate</p>
  </div>
  <div slot="centerRight" class="bg-secondary/10 p-6 rounded-lg border-2 border-secondary/30">
    <div class="text-3xl font-bold text-secondary mb-2">24/7</div>
    <p class="text-normal">Support Available</p>
  </div>
  <div slot="right" class="bg-accent/10 p-6 rounded-lg border-2 border-accent/30">
    <div class="text-3xl font-bold text-accent mb-2">150+</div>
    <p class="text-normal">Countries</p>
  </div>
</FourColumnContainer>

6. Product Features

📱

Mobile First

Optimized for all mobile devices with responsive design.

⚡

Lightning Fast

Blazing fast performance with optimized code.

🎨

Customizable

Fully customizable with Tailwind CSS utilities.

🔧

Easy Setup

Get started in minutes with simple configuration.

product-features
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
---

<FourColumnContainer
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-12' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  gap="loose"
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left">
    <div class="bg-linear-to-br from-primary to-primary-hover w-16 h-16 rounded-lg mb-4 flex items-center justify-center text-background text-2xl">
      📱
    </div>
    <p class="font-semibold">Mobile First</p>
    <p class="text-sm text-normal">Optimized for all mobile devices with responsive design.</p>
  </div>
  <div slot="centerLeft">
    <div class="bg-linear-to-br from-success to-success-hover w-16 h-16 rounded-lg mb-4 flex items-center justify-center text-background text-2xl">
      ⚡
    </div>
    <p class="font-semibold">Lightning Fast</p>
    <p class="text-sm text-normal">Blazing fast performance with optimized code.</p>
  </div>
  <div slot="centerRight">
    <div class="bg-linear-to-br from-secondary to-secondary-hover w-16 h-16 rounded-lg mb-4 flex items-center justify-center text-background text-2xl">
      🎨
    </div>
    <p class="font-semibold">Customizable</p>
    <p class="text-sm text-normal">Fully customizable with Tailwind CSS utilities.</p>
  </div>
  <div slot="right">
    <div class="bg-linear-to-br from-accent to-accent-hover w-16 h-16 rounded-lg mb-4 flex items-center justify-center text-background text-2xl">
      🔧
    </div>
    <p class="font-semibold">Easy Setup</p>
    <p class="text-sm text-normal">Get started in minutes with simple configuration.</p>
  </div>
</FourColumnContainer>
Code on a laptop screen
Audience at a conference talk
Open dictionary page
Hand writing in a notebook
image-gallery
---
import FourColumnContainer from '@alfadormx/blocks/layout/FourColumnContainer.astro';
import Image from '@alfadormx/blocks/primitives/Image.astro';
---

<FourColumnContainer
  containerWidthType="full"
  content={{
    widthType: 'boxed',
    spacing: { padding: 'py-8' },
    border: { width: 'border', color: 'border-border-emphasis border-dotted' },
  }}
  border={{ width: 'border', color: 'border-border' }}
  gap="tight"
  spacing={{ margin: 'mb-8' }}
>
  <div slot="left">
    <Image
      src="~/assets/images/content/code-on-laptop.jpg"
      alt="Code on a laptop screen"
      width={400}
      height={192}
      class="w-full h-48 object-cover rounded"
    />
  </div>
  <div slot="centerLeft">
    <Image
      src="~/assets/images/content/conference-audience.jpg"
      alt="Audience at a conference talk"
      width={400}
      height={192}
      class="w-full h-48 object-cover rounded"
    />
  </div>
  <div slot="centerRight">
    <Image
      src="~/assets/images/content/dictionary-page.jpg"
      alt="Open dictionary page"
      width={400}
      height={192}
      class="w-full h-48 object-cover rounded"
    />
  </div>
  <div slot="right">
    <Image
      src="~/assets/images/content/writing-notebook.jpg"
      alt="Hand writing in a notebook"
      width={400}
      height={192}
      class="w-full h-48 object-cover rounded"
    />
  </div>
</FourColumnContainer>

API Reference

PropTypeDefaultDescription
gapGridGap'normal'Gap between columns, responsive (default: 'normal')
responsivebooleanfalseResponsive behavior (default: false - always side-by-side)
breakpointstring'md:'Responsive breakpoint (default: 'md:' - use 'sm:', 'lg:', etc.)
leftColumnCellProps—Configuration for the leftmost column
centerLeftColumnCellProps—Configuration for the center-left column
centerRightColumnCellProps—Configuration for the center-right column
rightColumnCellProps—Configuration for the rightmost column