To get Lovable's AI to build the layout you want, describe your UI in terms of structure (rows, columns, grids), component names (sidebar, header, card), and specific measurements (3-column grid, 250px sidebar). Reference existing components with the @ syntax and provide visual examples by importing from Figma via Builder.io. Vague prompts like 'make it look good' produce unpredictable results — specific structural descriptions produce accurate layouts every time.
Why UI layout descriptions need structure for Lovable AI
Lovable's AI interprets your natural language prompts and generates React components with Tailwind CSS. The more precisely you describe a layout, the more accurately the AI builds it. But most users write vague prompts like 'make a dashboard' or 'add a nice landing page,' which gives the AI too much creative freedom — resulting in layouts that look nothing like what you imagined. The key insight is that layout descriptions should mirror how developers think about structure: containers, rows, columns, spacing, and alignment. You do not need to know CSS — just describe the visual arrangement using everyday language that maps to specific layout patterns. Saying 'a two-column layout with a narrow sidebar on the left and the main content on the right' produces much better results than 'add a sidebar.' Lovable also supports referencing existing components with the @ syntax and importing designs from Figma through the Builder.io partnership. These tools let you show the AI exactly what you want instead of trying to describe it in words.
- Vague prompts — 'make it look good' gives the AI too much creative freedom and produces unpredictable results
- Missing structural details — not specifying rows, columns, or grid layouts leads to single-column stacking
- No reference to existing components — the AI creates new components instead of building on what already exists
- Mixing layout and content requests — asking for layout structure and content population in the same prompt confuses priority
- No Figma import — describing complex visual designs in words when an image or Figma file would be more precise
Error messages you might see
Component renders as a single column instead of the expected grid layoutYour prompt likely described the content but not the layout structure. The AI defaults to stacking elements vertically. Explicitly describe the grid: 'Use a 3-column grid with equal widths and 16px gaps between cards.'
Sidebar overlaps with main content on smaller screensYou described a fixed sidebar but did not specify responsive behavior. Add: 'On mobile, hide the sidebar and show a hamburger menu. On desktop, show the sidebar at 250px width.'
Layout looks completely different from what I describedThe prompt was too abstract. Instead of 'a modern dashboard layout,' describe the exact structure: 'A fixed header at the top, a sidebar on the left (250px wide), and a scrollable main content area that fills the remaining space.'
Before you start
- A Lovable project open in the editor
- A clear mental picture or sketch of the layout you want (even a rough pencil drawing helps)
- Knowledge of your existing component names (check in Dev Mode or ask Plan Mode to list them)
How to fix it
Describe layout structure using rows, columns, and containers
Structural descriptions map directly to CSS layout patterns, giving the AI clear instructions
Describe layout structure using rows, columns, and containers
Structural descriptions map directly to CSS layout patterns, giving the AI clear instructions
Start every layout prompt with the overall structure before adding details. Use terms like: 'full-width header,' 'two-column layout,' '3-column grid,' 'sidebar on the left,' 'sticky footer,' 'centered container with max-width.' Specify dimensions where they matter: '250px sidebar,' '64px header height,' '16px gap between cards.' The AI translates these into Tailwind classes like flex, grid-cols-3, w-64, and gap-4.
// Vague prompt that produces unpredictable results:// "Create a dashboard page for my app"// Structured prompt that produces exactly what you want:// "Create a dashboard page with this layout:// 1. A sticky header at the top (64px height, full width, white background, bottom border)// 2. Below the header, a two-column layout:// - Left sidebar (250px wide, full height, light gray background)// - Main content area (fills remaining width, scrollable)// 3. In the main content area, a 3-column grid of stat cards with 16px gaps// 4. Below the grid, a full-width chart section// 5. On mobile, hide the sidebar and stack everything in a single column"Expected result: The AI generates a dashboard with the exact structure you described — header, sidebar, grid, and chart section in the correct positions.
Reference existing components with @ syntax
The @ syntax tells the AI exactly which file to modify or build upon, preventing it from creating duplicates
Reference existing components with @ syntax
The @ syntax tells the AI exactly which file to modify or build upon, preventing it from creating duplicates
When you want to modify an existing layout or add to a specific component, use the @ syntax to reference the file directly. This scopes the AI's changes to that file and its immediate context. For example: '@src/pages/Dashboard.tsx add a sidebar to the left of the current content area, 250px wide, with navigation links for Home, Analytics, and Settings.' Without the @ reference, the AI might create an entirely new page instead of modifying the existing one.
// Prompt without file reference — AI might create a new file// "Add a sidebar to my dashboard"// Prompt with @ reference — AI modifies the exact file// "In @src/pages/Dashboard.tsx, add a sidebar to the left// of the existing content. The sidebar should be:// - 250px wide with a light gray background// - Sticky (stays in place while main content scrolls)// - Contains navigation links: Home, Analytics, Settings, Profile// - Each link has an icon from lucide-react and text label// - Active link has a blue background// - Do not change the existing main content area"Expected result: The AI modifies only the referenced file, adding the sidebar alongside the existing content without creating duplicate files or breaking other components.
Use Figma import for complex visual designs
Showing the AI a design is more precise than describing it in words for visually complex layouts
Use Figma import for complex visual designs
Showing the AI a design is more precise than describing it in words for visually complex layouts
Lovable partners with Builder.io for Figma import. If you have a design in Figma, you can import it directly. In the Lovable editor, use the Figma import feature (available through the prompt interface) to convert a Figma frame into a React component. This works best for pixel-perfect layouts where describing every detail in words would be impractical. Even a rough Figma mockup gives the AI much more accurate direction than a text prompt alone.
// Trying to describe a complex hero section in words:// "Create a hero section with a gradient background,// a headline, subtext, two buttons side by side,// and an image on the right side floating slightly// above the buttons with a shadow..."// Better approach: import from Figma// 1. Create a rough mockup in Figma (even basic shapes and text)// 2. In Lovable, use the prompt: "Import this Figma design// and convert it to a responsive React component// using Tailwind CSS. Use shadcn/ui Button components// for the call-to-action buttons."//// Or reference a screenshot:// "Build a hero section that looks like this reference image.// [paste or describe the image]// Use a gradient from blue-600 to purple-600, white text,// and two shadcn/ui Buttons (primary and outline variants)."Expected result: The AI generates a component that closely matches the Figma design, with proper Tailwind classes and responsive behavior.
Break complex layouts into sequential prompts
One massive prompt with every detail overwhelms the AI — sequential prompts produce better results
Break complex layouts into sequential prompts
One massive prompt with every detail overwhelms the AI — sequential prompts produce better results
Instead of describing an entire page layout in one prompt, break it into steps. First prompt: create the overall page structure (header, sidebar, main area). Second prompt: populate the header with specific content. Third prompt: add the card grid to the main area. Fourth prompt: make everything responsive. Each prompt builds on the previous result, and you can course-correct at each step. If the layout involves coordinating many generated components across multiple pages, RapidDev's engineers can design the complete layout architecture for you.
// One giant prompt — overwhelming and error-prone:// "Create a complete e-commerce product page with a sticky// header that has a logo, search bar, cart icon, and user// menu. Below that a breadcrumb, then a two-column layout// with product images on the left (image carousel with// thumbnails), product details on the right (title, price,// description, size selector, add to cart button), then// a reviews section below with star ratings, and a related// products carousel at the bottom with 4 visible cards..."// Sequential prompts — each builds on the last://// Prompt 1 (structure):// "Create a product page at @src/pages/ProductPage.tsx with// this structure: sticky header, breadcrumb row, two-column// layout (left 60% for images, right 40% for details),// full-width reviews section below, and a related products// section at the bottom. Use placeholder text for now."//// Prompt 2 (images section):// "In @src/pages/ProductPage.tsx, replace the left column// placeholder with an image carousel. Show one large image// and a row of 4 thumbnail images below it. Clicking a// thumbnail updates the large image."//// Prompt 3 (product details):// "In @src/pages/ProductPage.tsx, replace the right column// placeholder with: product title (h1), price ($49.99),// a size selector dropdown, quantity input, and an// Add to Cart button using shadcn/ui Button."//// Prompt 4 (responsive):// "Make @src/pages/ProductPage.tsx responsive. On mobile,// stack the image and details in a single column. Hide// the thumbnail row on screens smaller than 640px."Expected result: Each step produces a verifiable result. You can adjust the direction between steps instead of starting over from a single failed prompt.
Complete code example
1# UI Layout Instructions23## Default Layout Standards45When creating new page layouts, follow these defaults unless the prompt specifies otherwise:671. **Page structure**: Sticky header (h-16), optional sidebar (w-64), scrollable main content82. **Container**: max-w-7xl mx-auto px-4 for centered content93. **Spacing**: Use consistent Tailwind spacing: gap-4 for tight groups, gap-6 for sections, gap-8 for major areas104. **Typography**: text-3xl font-bold for page titles, text-lg for subtitles, text-base for body115. **Cards**: Use shadcn/ui Card component with consistent padding (p-6)1213## Responsive Behavior1415- Mobile-first: default styles are for mobile, use md: and lg: for larger screens16- Grid columns: 1 on mobile, 2 on md:, 3 on lg:17- Sidebar: hidden on mobile (hidden md:block), full-width drawer on mobile if needed18- Images: w-full with aspect-ratio for consistent sizing1920## Component References2122- Navigation: @src/components/Navbar.tsx23- Sidebar: @src/components/Sidebar.tsx24- Footer: @src/components/Footer.tsx25- Card grid: use CSS Grid (grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3)2627## Do Not2829- Do not use fixed pixel widths for containers (use max-w-* instead)30- Do not create new layout components if one already exists31- Do not remove existing responsive classes when adding new featuresBest practices to prevent this
- Start every layout prompt with the overall structure (header, sidebar, main, footer) before adding detail
- Use precise terms: 'two-column layout,' '3-column grid,' '250px sidebar,' '64px header' — these map directly to Tailwind classes
- Always specify responsive behavior: 'On mobile, stack in a single column. On desktop, show the two-column layout'
- Reference existing components with @ syntax to prevent the AI from creating duplicates
- Break complex layouts into sequential prompts — structure first, then content, then responsive behavior
- Use Figma import for visually complex designs where words are not precise enough
- Add layout standards to AGENTS.md so every new page follows consistent structural patterns
- Use Plan Mode to ask 'What layout components already exist in my project?' before creating new ones
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I need to describe a UI layout to Lovable (lovable.dev) AI so it generates exactly what I want. My project uses React + Tailwind CSS + shadcn/ui. Here is what I want the page to look like: [Describe your layout in as much detail as possible: header, columns, sidebar, grids, spacing, mobile behavior] Here is my current page component: [Paste your current component code, if any] Please: 1. Rewrite my layout description as a precise Lovable prompt that uses structural terms (grid, columns, rows, containers) 2. Include responsive behavior instructions for mobile 3. Reference specific Tailwind classes I should mention 4. Suggest whether I should use one prompt or break it into sequential steps 5. Format the prompt so I can paste it directly into Lovable
Using Plan Mode: Look at the current layout in @src/pages/Dashboard.tsx and tell me: 1) What is the current structure (header, sidebar, main content arrangement)? 2) What responsive breakpoints are currently used? 3) What components are already created that I can reference? 4) Suggest how to restructure the page as a two-column layout with a 250px sidebar and 3-column card grid. Do not modify any code — just describe the plan.
Frequently asked questions
How do I describe UI layouts clearly to Lovable AI?
Use structural terms that map to CSS layout patterns: rows, columns, grids, sidebars, headers, footers. Include specific measurements: '3-column grid with 16px gaps,' '250px sidebar,' '64px header height.' Always specify responsive behavior: 'On mobile, stack in a single column.' Reference existing components with @ syntax to build on what exists.
Can I import Figma designs into Lovable?
Yes. Lovable partners with Builder.io for Figma import. You can convert Figma frames into React components with Tailwind CSS. This is the most accurate method for complex visual designs where describing every detail in words would be impractical.
Why does Lovable create a completely different layout than what I described?
Your prompt was likely too abstract. Phrases like 'modern dashboard' or 'nice landing page' are open to interpretation. Instead, describe the exact structure: 'A fixed header, a 250px sidebar on the left, and a scrollable main area with a 3-column card grid.' The more specific you are, the more accurate the result.
Should I describe the entire page layout in one prompt?
No. Break complex layouts into sequential prompts. First: overall structure (header, sidebar, main). Second: content for each section. Third: responsive behavior. This gives you checkpoints to course-correct between steps and produces better results than one overwhelming prompt.
How do I reference existing components in my Lovable prompts?
Use the @ syntax followed by the file path. For example: '@src/pages/Dashboard.tsx add a sidebar to the left of the current content.' This tells the AI to modify the specific file instead of creating a new one. You can find file paths in Dev Mode or by asking Plan Mode to list your project's components.
What if the AI keeps generating layouts that don't match my vision?
If text prompts are not working, try: 1) Use Figma import for complex designs. 2) Add default layout standards to AGENTS.md. 3) Use Plan Mode to analyze the current layout before making changes. If you need pixel-perfect layouts across multiple pages, RapidDev's engineers can translate your designs into properly structured Lovable prompts.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your issue.
Book a free consultation