How to add a drop-down menu to your website
A drop-down menu groups related pages under one item in your navigation bar. Instead of six links side by side, visitors see one label, such as Services, and choose the page they want from a short list. Your header stays tidy, and people find the right page faster. In Aglyn you add one in the editor in about a minute, without writing any code.
Before you start
- Find where your navigation bar lives. On most sites it is part of the shared layout: the header and footer every page uses. You edit it there once, and every page picks up the change.
- Have the pages ready. The menu links to pages that already exist. If one is missing, publish it first.
- Pick a short label that describes the group, such as Services, Shop or Resources.
Step 1: Open your layout and select your links
Open any page in the editor. If the header comes from a shared layout, a blue bar at the top of the canvas says so, and the header is locked on that page. Choose Edit layout to open the layout itself.
Then click the row that holds your links, in the gap between two of them, so the whole row is selected. A new element goes in at the end of whatever you select, so selecting the row puts the menu right beside your other links.
Step 2: Add a Dropdown Menu
Choose + to open the element picker, go to the Navigation group, pick Dropdown Menu and choose Confirm. The menu lands at the end of your links with three placeholder links inside, and it opens on the canvas so you can edit what is in it.
The same group has two relatives worth knowing. Mega Menu opens a wide panel with columns of links, for sites with many pages. Mobile Nav adds a menu button and a slide-in drawer for phones.
Step 3: Set the label and match your other links
In Attributes, type the Label: the words visitors see in the navigation bar. The settings below it control how that nav item looks, and they work the same way as on your other links:
- Render as: Button draws it like a nav button, Text link draws a plain label. Either one opens the menu.
- Theme color and Size: leave them as they are if your links use the defaults.
- Variant: Text, Outlined or Contained. A new menu starts as Outlined. If your other links are plain words, set it to Text so the new item matches.
Check the canvas afterwards. Apart from its small arrow, the new item should look exactly like its neighbors.
Step 4: Set each link's text and page
Each link inside the menu is a Page Link. Select one, type its Text, then choose its Page from the list of your site's pages. Picking the page, rather than typing an address, keeps the link working if that page's address changes later.
Need another link? Select the menu, choose +, and add a Page Link from the Navigation group. It goes in at the end of the menu. A new Page Link starts as Outlined, so set its Variant to Text to match the others.
Step 5: Save and publish
Open the menu on the save button. Save draft keeps your work without touching the live site. Save & publish saves and updates the live site. Because the menu lives in your layout, every page that uses the layout gets it at once.
On the live site, visitors click the label to open the menu. It closes when they click anywhere else or press Esc.
Make it open on hover
Some sites open their menus as soon as the pointer reaches them. That takes one interaction on the menu itself. Select the menu, open the Interactions tab, choose Add interaction, then When hovered…. Set the action to Open a menu, keep the menu set to This element, and choose Create. Save and publish again.
A menu opened on hover closes by itself when the pointer leaves the label and the panel, with a short pause so the pointer can travel from one to the other.
Common questions
How many links should a drop-down menu hold?
Few enough to read at a glance. If a group grows past a handful of pages, split it into two menus or use a Mega Menu, which lays links out in columns.
Can a drop-down menu hold more than links?
Yes. Page links are the usual content, but you can place other elements inside the menu too.
What do visitors on phones see?
For small screens, the Mobile Nav element in the same Navigation group gives you a menu button that opens a slide-in drawer of links, and shows your normal row of links on larger screens. Swap its placeholder links for your pages and it is ready.
Do I need to write any code?
No. Every step above uses settings in the editor.
Next steps
- Read the Menus and navigation guide for mega menus, drawers and more ways to open a menu.
- Need a page to put in your menu? Follow How to publish your first page on your website.
- Change the words on your pages next: How to edit and add text on your website.
- See everything the website editor can do, or how Aglyn works for a small business.
Share this article
We're building the open web platform. Follow along as we ship — and tell us what you need.