# Header Submenus

**URL:** https://meta.discourse.org/t/header-submenus/94584
**Category:** Theme component
**Tags:** official, header-submenus
**Created:** [August 13, 2018, 9:50am UTC](https://meta.discourse.org/t/header-submenus/94584 "2018-08-13T09:50:07Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [August 13, 2018, 9:50am UTC](https://meta.discourse.org/t/header-submenus/94584/1 "2018-08-13T09:50:07Z")

</div>

| | | |
| --- | --- | --- |
| :discourse2: | **Summary** | **Header Submenus** will allow you to build a header menu - with submenus - using plain text! |
| 👓 | **Preview** | [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/header-submenus) |
| 🛠 | **Repository Link** | [https://github.com/discourse/discourse-header-submenus](https://github.com/discourse/discourse-header-submenus) |
| 📖 | **New to Discourse Themes?** | [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) |

Install this theme component

> [@](#):
>
> :discourse2: As this is an #official theme component maintained by the Discourse team, #Support, #Contribute > Bug, #Contribute > UX, and #Contribute > Feature requests can be made in the respective categories here on Meta, and tagged with the appropriate theme component tag. Click on a link below to get one started. 👍
> 
> [❓&nbsp; **Support**](https://meta.discourse.org/new-topic?category_id=6&tags=header-submenus "Ask for support on configuring and using Header Submenus") [🐛&nbsp; **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=header-submenus "A bug report means something is broken, preventing normal/typical use of the theme component") [👀&nbsp; **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=header-submenus "Discussion about the user interface of Header Submenus, and how features are presented (including language and UI elements)") [💡&nbsp; **Feature**](https://meta.discourse.org/new-topic?category_id=2&tags=header-submenus "Discussion about how existing Header Submenus features can be improved or enhanced, and how proposed new features could work")

### Features

Desktop

 ![1](https://global.discourse-cdn.com/meta/original/3X/8/6/86ac63e59f37ae152f40d86f412042df2b6221ba.png)

 ![2](https://global.discourse-cdn.com/meta/original/3X/8/4/84f01d0c212808a74c5afe0fbf34a86bb677cbaa.png)

Mobile

 ![3](https://global.discourse-cdn.com/meta/original/3X/9/a/9a682a809379f3e8a133d6df0826bb17cc849c0d.png)

### Settings

| Name | Description |
| --- | --- |
| Menu items | Add menu items. One item per line in this order: Text, icon, title, view. |
| Submenu items | Add submenu items. One item per line in this order: Parent, text, icon, URL, target, title. |
| Svg icons | Include FontAwesome icon classes for each icon used in the lists above. |
| Fixed mode | Force the menu to be visible at the top of the screen regardless of scroll position - Desktop only |
| Show caret | Show caret icons next to menu items |
| Invert position | Display menu items on the opposite side of the screen |
| Menu background | Background color for the menu. (hex, rgb, rgba or CSS color name) |
| Menu item color | Color for menu items. (hex, rgb, rgba or CSS color name) |
| Menu-item-active-background | Background color for menu items when active. (hex, rgb, rgba or CSS color name) |
| Menu-item-active-color | Color for menu items when active. (hex, rgb, rgba or CSS color name) |
| Submenu background | Background color for submenus. (hex, rgb, rgba or CSS color name) |
| Submenu item color | Color for submenu items. (hex, rgb, rgba or CSS color name) |
| Submenu item hover background | Background color for submenus items when hovered. (hex, rgb, rgba or CSS color name) |
| Submenu item hover color | Color for submenus items when hovered. (hex, rgb, rgba or CSS color name) |
| Divider color | Color for divider lines in submenus. (hex, rgb, rgba or CSS color name) |

There are four groups of settings

1. **Menu items**

2. **Submenu items**

Here’s a quick example to cover points 1 and 2 above:

Let’s say I want to add a menu item called `Design` and add a few items to its submenu like so

 ![4](https://global.discourse-cdn.com/meta/original/3X/0/e/0e69c8d14bba158cd288d5ead00d23327b73c605.png)

I would first enter this as a `menu_item`

`Design, magic, Get inspired!, vdm`

And then enter these as `sub_menu` items

`Design, Galleries, th, #, blank, Cool galleries for you to look at.`  
`Design, Design process, lightbulb-o, #, blank, Learn the basics.`  
`Design, Blog design, columns, #, blank, What makes for a great blog?`  
`Design, divider`  
`Design, Freebies, gift, #, blank, Everyone likes freebies!`  
`Design, Photoshop tutorials, book, #, blank, Photoshop for beginners.`  
`Design, Design trends, bar-chart, #, blank, Stay on top of the current trends!`

That’s it!

The theme comes with a placeholder menu by default, so have a look at that and ask if you have questions.

1. **Layout options.**

2. **Color options**

  

> :discourse2: **Hosted by us?** Theme components are available to use on our Standard, Business, and Enterprise plans.

> Last edited by @JammyDodger 2024-06-12T21:46:41Z
> 
> > **Check document**
> >
> > Perform check on document:

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [May 14, 2020, 6:50am UTC](https://meta.discourse.org/t/header-submenus/94584/58 "2020-05-14T06:50:52Z")

</div>

I just pushed an update to this component.

[https://github.com/discourse/discourse-header-submenus/commit/cbb1c280f031024335cf3b103b0e2c242c5862b1](https://github.com/discourse/discourse-header-submenus/commit/cbb1c280f031024335cf3b103b0e2c242c5862b1)  
There are no visual changes and if you’ve added custom CSS to your theme, it should still work because the component still has the same classes.

I dropped the external library that the component previously used and jQuery by extension. I went through the issues reported here, fixed the one I could reproduce and then deleted the replies to keep everything tidy. If your problem still persists after the update, please feel free to post it.

Beyond that, the update only adds one new feature. The submenus will now show on hover on desktop instead of requiring a click.

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [May 31, 2020, 6:54pm UTC](https://meta.discourse.org/t/header-submenus/94584/67 "2020-05-31T18:54:14Z")

</div>

Nice update Joe, I’ve only run into two problems on mobile.

1. You can no longer scroll side to side if you have a lot of menu items.
2. When you tap an item in the dropdown, the dropdown stays open

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [May 31, 2020, 7:10pm UTC](https://meta.discourse.org/t/header-submenus/94584/68 "2020-05-31T19:10:51Z")

</div>

> [@davidkingham](#):
>
> You can no longer scroll side to side if you have a lot of menu items.

This _should_ still work, but it’s only on the mobile view. So, if you just test it the browser fake mobile view without changing the user agent, it won’t work. Can you please confirm that you’re testing this on an actual phone. If so, can you let me know what device / browser you’re using?

> [@davidkingham](#):
>
> When you tap an item in the dropdown, the dropdown stays open

I see this too. The reason is that all the dropdown (opening / closing) behaviour is now handled with CSS instead of JavaScript. I don’t think CSS has a way to handle auto closing the dropdown after you click it. So, we have to fallback to JS for that particular issue. I’ll do it after you confirm the scroll issue on mobile.

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [May 31, 2020, 7:15pm UTC](https://meta.discourse.org/t/header-submenus/94584/69 "2020-05-31T19:15:09Z")

</div>

This is on an iPhone 8 with the Discourse app, same in Safari. Thanks Joe!

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [July 4, 2020, 1:55pm UTC](https://meta.discourse.org/t/header-submenus/94584/70 "2020-07-04T13:55:51Z")

</div>

Any update on this Joe? Thanks!

---

<div class="post-metadata">

### Author: ![fidelio](https://avatars.discourse-cdn.com/v4/letter/f/f1d935/32.png) [@fidelio](https://meta.discourse.org/u/fidelio)
#### Post date: [July 17, 2020, 9:23am UTC](https://meta.discourse.org/t/header-submenus/94584/72 "2020-07-17T09:23:33Z")

</div>

Over at the Sponge community site they have a nice integration of this in the main header instead of an extra layer at the top:

> **[Sponge Forums](https://forums.spongepowered.org)**
>
> Sponge: A new Minecraft modding API combining the strengths of the server and client modding communities.

How can this be achieved? Would love it for our site.

---

<div class="post-metadata">

### Author: ![AntiMetaman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/antimetaman/32/186978_2.png) [@AntiMetaman](https://meta.discourse.org/u/AntiMetaman)
#### Post date: [July 17, 2020, 6:30pm UTC](https://meta.discourse.org/t/header-submenus/94584/74 "2020-07-17T18:30:44Z")

</div>

Can submenus be possible to header links? This theme component adds a new menu above the header, but some people don’t want a new navigation menu. They just want ability to hover over the current header links and have submenus.

---

<div class="post-metadata">

### Author: ![Hugh\_Roberts](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hugh_roberts/32/181083_2.png) [@Hugh\_Roberts](https://meta.discourse.org/u/Hugh_Roberts)
#### Post date: [July 22, 2020, 12:48pm UTC](https://meta.discourse.org/t/header-submenus/94584/75 "2020-07-22T12:48:20Z")

</div>

That is nice. I wonder how they did it.

---

<div class="post-metadata">

### Author: ![ElForoViajero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elforoviajero/32/187116_2.png) [@ElForoViajero](https://meta.discourse.org/u/ElForoViajero)
#### Post date: [July 23, 2020, 11:43am UTC](https://meta.discourse.org/t/header-submenus/94584/77 "2020-07-23T11:43:09Z")

</div>

is someone having this issue? the social networks icons are not working (they were) and even using a different fa it won’t show.

 ![Captura de pantalla 2020-07-23 a les 13.42.16](https://global.discourse-cdn.com/meta/original/3X/f/f/ff94cc39e3f2aa6ed1fea6998dce9c713ec2dfc9.png)

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [July 23, 2020, 4:52pm UTC](https://meta.discourse.org/t/header-submenus/94584/78 "2020-07-23T16:52:36Z")

</div>

Have you tried the prefix of `fab`, since these are brands they need to have this prefix.

---

<div class="post-metadata">

### Author: ![ElForoViajero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elforoviajero/32/187116_2.png) [@ElForoViajero](https://meta.discourse.org/u/ElForoViajero)
#### Post date: [July 24, 2020, 10:11am UTC](https://meta.discourse.org/t/header-submenus/94584/80 "2020-07-24T10:11:06Z")

</div>

thansk for you reply @davidkingham I added the prefix fab, but the logo doesn’t appear.

 ![Captura de pantalla 2020-07-24 a les 12.10.25](https://global.discourse-cdn.com/meta/original/3X/0/b/0b8b0019181c54452b3ff64d2b3626e7cc0a48ef.png)

---

<div class="post-metadata">

### Author: ![Steven](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven/32/187890_2.png) [@Steven](https://meta.discourse.org/u/Steven)
#### Post date: [July 24, 2020, 10:13am UTC](https://meta.discourse.org/t/header-submenus/94584/81 "2020-07-24T10:13:47Z")

</div>

Don’t forget to edit the icons in the list of links also, you must include fab- prefix in these

---

<div class="post-metadata">

### Author: ![ElForoViajero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elforoviajero/32/187116_2.png) [@ElForoViajero](https://meta.discourse.org/u/ElForoViajero)
#### Post date: [July 24, 2020, 10:20am UTC](https://meta.discourse.org/t/header-submenus/94584/82 "2020-07-24T10:20:14Z")

</div>

Bingo! that was it 🙂 thanks a lot!

---

<div class="post-metadata">

### Author: ![Sentinelrv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sentinelrv/32/64330_2.png) [@Sentinelrv](https://meta.discourse.org/u/Sentinelrv)
#### Post date: [August 2, 2020, 8:14pm UTC](https://meta.discourse.org/t/header-submenus/94584/83 "2020-08-02T20:14:59Z")

</div>

Hi, I’m not sure why but the setting “Menu-item-active-background” doesn’t seem to be working right. I believe it should just change the background color of the menu when I hover, however the selected color is completely covering up the text. See here…

 ![Menu-item-active-background](https://global.discourse-cdn.com/meta/original/3X/0/a/0a62774c42eaf945d3aca5094ce75e0c57b1955f.png)

Also, the setting below it " Menu-item-active-color" doesn’t seem to do anything. I’ve tried different color codes and nothing changes when I go to test it.

Any ideas?

---

<div class="post-metadata">

### Author: ![Moksh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moksh/32/188137_2.png) [@Moksh](https://meta.discourse.org/u/Moksh)
#### Post date: [August 11, 2020, 7:46am UTC](https://meta.discourse.org/t/header-submenus/94584/85 "2020-08-11T07:46:52Z")

</div>

I would like to place the submenus below the site header instead of top. Could you please tell me how to do this? A code snippet would help 🙏

---

<div class="post-metadata">

### Author: ![Moksh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moksh/32/188137_2.png) [@Moksh](https://meta.discourse.org/u/Moksh)
#### Post date: [August 12, 2020, 9:01am UTC](https://meta.discourse.org/t/header-submenus/94584/86 "2020-08-12T09:01:02Z")

</div>

> [@Johani](#):
>
> > [@davidkingham](#):
> >
> > 1. When you tap an item in the dropdown, the dropdown stays open
> 
> I see this too. The reason is that all the dropdown (opening / closing) behaviour is now handled with CSS instead of JavaScript. I don’t think CSS has a way to handle auto closing the dropdown after you click it. So, we have to fallback to JS for that particular issue. I’ll do it after you confirm the scroll issue on mobile.

@Johani @davidkingham Did you find a solution for this problem “When you tap an item in the dropdown, the dropdown stays open” ?

Thank you

---

<div class="post-metadata">

### Author: ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)
#### Post date: [August 12, 2020, 2:16pm UTC](https://meta.discourse.org/t/header-submenus/94584/87 "2020-08-12T14:16:39Z")

</div>

No it’s still behaving this way, one potential solution is to show only icons on mobile with no text, thoughts?

---

<div class="post-metadata">

### Author: ![Moksh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moksh/32/188137_2.png) [@Moksh](https://meta.discourse.org/u/Moksh)
#### Post date: [August 12, 2020, 2:18pm UTC](https://meta.discourse.org/t/header-submenus/94584/88 "2020-08-12T14:18:50Z")

</div>

How showing just icons on mobile solves the problem? "When you tap an item in the dropdown, the dropdown stays open”

---

<div class="post-metadata">

### Author: ![Moksh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moksh/32/188137_2.png) [@Moksh](https://meta.discourse.org/u/Moksh)
#### Post date: [August 12, 2020, 2:20pm UTC](https://meta.discourse.org/t/header-submenus/94584/89 "2020-08-12T14:20:59Z")

</div>

@ElForoViajero Your submenus seem to work okay on both desktop and mobile. As soon as you click the item in the menu, the screen refreshes and the menu closes automatically. Did you have to do something special?

> **[RTP LIVE: Situs Bocoran RTP Slot Terbaru | Info Pola Hoki RTP Pragmatic Play...](https://www.bowspeed.com/)**
>
> RTP Slot merupakan bocoran situs pola gacor terbaru rtp pragmatic play super scatter ter-akurat dengan winrate tertinggi dijamin memberikan kemenangan maxwin super jackpot bersama slot terbaru di tahun 2026 ini.

[Next page](https://meta.discourse.org/t/header-submenus/94584.md?page=2)
