How do I make a mobile menu in Lovable?
Last checked 31 Aug 2026
Short answer
Ask Lovable to add a hamburger menu using shadcn/ui's Sheet or Drawer component that opens a slide-out nav below the tablet breakpoint, keeping the existing desktop nav bar unchanged above it.
What to ask for
Lovable's component library (shadcn/ui) already includes a Sheet (slide-out panel) component well suited to mobile navigation, so you don't need custom code — just describe the behaviour:
Add a mobile navigation menu: below the md breakpoint, replace the nav links with a hamburger icon that opens a slide-out menu (from the right) containing the same links and the primary CTA button. Keep the existing horizontal nav on desktop unchanged.
What a good mobile menu includes
- A clearly tappable hamburger icon (not too small — 44px touch target).
- The same links as desktop, in the same order, plus the primary CTA.
- A visible close button (X) inside the open menu, not just tap-outside-to-close.
- Body scroll locked while the menu is open, so the page behind doesn't scroll.
- Smooth open/close, but nothing so slow it feels laggy.
After it's built, check
- Menu opens and closes reliably on a real phone, not just in Preview.
- Links inside the menu actually close the menu after navigating (a common miss).
- The menu doesn't overlap a sticky header or CTA if you have one — see /questions/how-do-i-make-a-sticky-header and /questions/how-do-i-make-a-sticky-mobile-cta.
- Menu items are legible against the panel background (contrast check).
What usually goes wrong
- The menu opens but tapping a link doesn't close it, leaving the overlay stuck open after navigation — explicitly ask for "close the menu on link click".
- Desktop nav and mobile menu link lists drift out of sync after later edits — if you add a nav link, ask Lovable to update both.
- Z-index conflicts with other fixed elements (sticky header, cookie banner) causing the menu to appear behind them — flag this specifically if it happens.
Sources
Was this answer helpful?
Related questions
- AnswerHow do I make my Lovable website look less AI-generated?Set a real colour palette, a font pairing and spacing scale up front, then ask Lovable to remove generic gradients, stock-photo hero clichés and default shadcn styling so the site reads as bespoke.
- AnswerHow do I add animations?Ask for specific, subtle animations (fade-in on scroll, hover states, a smooth page transition) rather than "add animations" generally — Lovable can use Tailwind transitions or a library like Framer Motion depending on what you need.
- AnswerHow do I improve accessibility?Ask Lovable to check colour contrast, add alt text to images, ensure keyboard navigation works, and use semantic HTML/ARIA labels — these cover most common accessibility gaps in generated sites without needing a full audit tool.
- AnswerHow do I make a sticky header?Ask Lovable to make the header `fixed` or `sticky` at the top with a defined z-index, and add top padding to the page content equal to the header's height so it isn't hidden underneath.