Layout Patterns for AI Coders
Common page layouts you'll build with AI. Know the structure, know the sections, and describe them precisely.
In this chapter
- The most common page layouts and what each is for
- How to describe a layout precisely to your AI tool
- When to use grids, columns, sidebars, and full-width sections
- How to make a layout that adapts cleanly to phones
“Create a landing page with a hero section, 3-column features grid, testimonials carousel, pricing table with 3 tiers, FAQ accordion, and footer.”
“Create a dashboard layout with a collapsible sidebar on the left, a top bar with search and user avatar, stat cards, a data table, and a chart section.”
“Create a blog post layout with a centered article (max-w-3xl), table of contents sidebar on desktop, author bio card at bottom, and related posts grid.”
“Create an e-commerce product listing page with a filter sidebar on the left, product cards in a 3-column grid, each with image, name, price, and Add to Cart button.”
“Create a personal portfolio with a hero showing my name and title, an about section, skills badges, project cards with screenshots, and a contact form.”
“Create a SaaS app layout with a top navbar, sidebar navigation, main content area, and a settings page with tabs for Profile, Billing, and Notifications.”
“Create a documentation site layout with a searchable sidebar on the left, main content with code blocks in the center, and on-page nav (table of contents) on the right.”
“Create a social media feed layout with a navigation bar, a centered feed of post cards (max-w-2xl), and a right sidebar with trending topics and suggested users.”
Prompt This
Copy-paste these prompts into your AI tool to apply what you just learned.
“Create a responsive page layout with a [sidebar / header / grid] using CSS Grid or Flexbox. It should work on mobile, tablet, and desktop. On mobile, stack everything vertically. On desktop, show the full layout.”
“Build a dashboard layout with a fixed sidebar on the left (240px wide), a top header bar (64px tall), and a scrollable main content area. The sidebar should collapse to icons on tablet and become a hamburger menu on mobile.”
“Create a landing page layout with these sections in order: navbar, hero with headline and CTA button, 3-column features grid, testimonials, pricing table with 3 tiers, FAQ accordion, and a footer. Make it fully responsive.”
Frequently Asked Questions
What layout should I use for my homepage?
The most common pattern is: full-width navbar, centered content with a max-width (usually 1200px), and a footer. Inside that, use a single column for text-heavy pages or a grid for cards and features. Start simple and add complexity only when needed.
When should I use Flexbox vs Grid?
Use Flexbox for one-dimensional layouts: things in a row or column (navbars, button groups, card rows). Use Grid for two-dimensional layouts: things in rows AND columns (dashboards, image galleries, pricing tables). Your AI tool will pick the right one if you describe what you want.
How do I make my layout look good on mobile?
Stack things vertically on small screens. A 3-column grid on desktop should become a single column on mobile. Use responsive breakpoints (sm, md, lg in Tailwind) to adjust. Tell your AI tool to 'make it responsive' and it will handle the breakpoints.