Container Query Section
Feature grid that uses CSS Container Queries (@container) to adapt card layout to container width โ not the viewport. Showcases Tailwind v4 @container support.
Quick Preview
Adapts to Any Context
These cards use container queries (@container / @md variants) to change layout based on their container โ not the viewport.
Container Queries
Tailwind v4Components adapt to their parent container width, not the viewport. Build truly reusable UI.
Design Tokens
CSS VariablesAll design tokens live in @theme inline โ colors, spacing, shadows and animations in one place.
Dark Mode
@custom-variantManual dark mode via @custom-variant dark โ add .dark class to enable, no flicker.
TypeScript
Strict ModeEvery component ships with strict TypeScript types and IntelliSense support.
OKLCH Colors
P3 ColorsPerceptually uniform color scale using OKLCH โ better interpolation, wider gamut.
@utility Classes
v4 FeatureDefine reusable CSS utilities with @utility โ they work with all Tailwind variants.
How it works
Each card wrapper has @container โ the inner layout uses @md:flex-row to switch from column to row once the card is wide enough.
@container / @md:flex-rowInstallation
// Copy component fromsrc/components/sections/ContainerQuerySection.tsx
Usage
import { ContainerQuerySection } from '@/components/sections/ContainerQuerySection'const items = [{icon: 'โก',title: 'Container Queries',description: 'Adapts layout to container width, not viewport.',badge: 'Tailwind v4',badgeColor: 'teal', // 'teal' | 'blue' | 'violet' | 'orange' | 'pink'},// ...more items]export default function Page() {return (<ContainerQuerySectiontitle="Why use our platform?"subtitle="Cards adapt their layout to their own container size."items={items}/>)}
Custom items
3-column custom items
Platform Features
Everything you need to ship faster.
Deploy in seconds
CI/CDPush to GitHub and your site goes live automatically via CI/CD.
Security first
SOC 2Zero-trust architecture with end-to-end encryption at rest and in transit.
Analytics built-in
Real-timeReal-time dashboards, custom events, and retention funnels included.
How it works
Each card wrapper has @container โ the inner layout uses @md:flex-row to switch from column to row once the card is wide enough.
@container / @md:flex-rowHow container queries work
// The card wrapper is the container<div className="@container">{/* Inner layout: column by default, row when container โฅ 28rem */}<div className="flex flex-col @md:flex-row gap-4"><div className="w-11 h-11 rounded-xl">Icon</div><div><h3>Title</h3><p>Description</p></div></div></div>// Container query breakpoints (Tailwind v4):// @xs โ 20rem (320px)// @sm โ 24rem (384px)// @md โ 28rem (448px) โ used in this component// @lg โ 32rem (512px)// @xl โ 36rem (576px)// @2xl โ 42rem (672px)// @3xl โ 48rem (768px)
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | - | Section heading |
subtitle | string | - | Section sub-heading |
items | ContainerQueryItem[] | - | Array of feature items |
className | string | - | Additional CSS classes |