@illinois-toolkit/ilw-header-megamenu 0.0.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +229 -261
- package/builder/ilw-header-megamenu.json +12 -12
- package/builder/versions/ilw-header-megamenu.1.0-alpha.json +70 -70
- package/builder/versions/ilw-header-megamenu.1.0.1.json +70 -0
- package/builder/versions/ilw-header-megamenu.1.0.json +70 -0
- package/builder/versions/ilw-header-megamenu.2.0-alpha.json +76 -0
- package/dist/MegaMenu.d.ts.map +1 -1
- package/dist/MegaMenuSection.d.ts +2 -8
- package/dist/MegaMenuSection.d.ts.map +1 -1
- package/dist/cdn/ilw-header-megamenu.css +1 -1
- package/dist/cdn/ilw-header-megamenu.js +317 -329
- package/dist/ilw-header-megamenu.css +1 -1
- package/dist/ilw-header-megamenu.js +111 -123
- package/package.json +49 -49
- package/src/MegaMenu.css +82 -79
- package/src/MegaMenu.styles.css +37 -36
- package/src/MegaMenu.ts +169 -144
- package/src/MegaMenuSection.css +231 -347
- package/src/MegaMenuSection.styles.css +242 -162
- package/src/MegaMenuSection.ts +220 -284
- package/src/ilw-header-megamenu.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Web at Illinois
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Web at Illinois
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,261 +1,229 @@
|
|
|
1
|
-
# ilw-header-megamenu
|
|
2
|
-
|
|
3
|
-
Links: **[ilw-header-megamenu in Builder](https://builder3.toolkit.illinois.edu/component/ilw-header-megamenu/index.html)** |
|
|
4
|
-
[Illinois Web Theme](https://webtheme.illinois.edu/) |
|
|
5
|
-
[Toolkit Development](https://github.com/web-illinois/toolkit-management)
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
An Illinois Mega Menu utilizes the standard design of the header menu,
|
|
10
|
-
|
|
11
|
-
The
|
|
12
|
-
|
|
13
|
-
---------
|
|
14
|
-
|
|
15
|
-
The ilw-header-megamenu should contain an unordered list. Each list item can contain one of three items:
|
|
16
|
-
|
|
17
|
-
- a simple link or button (`<a>` or `<button>`)
|
|
18
|
-
- an <ilw-header-megamenu-section> that contains a span and at least one unordered list of links. The span should contain `slot="label"`.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Within each `ilw-header-megamenu-section`
|
|
22
|
-
- a basic unordered list of less than 20 links and no nesting. Each list item will be divided into groups of 5 or less. Adding more than 20 items will result in missing links.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Optional
|
|
27
|
-
- a decorative image
|
|
28
|
-
- a `<span>` containing a paragraph element and a
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
`span-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
<li><a href="/">
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<li><a href="/">
|
|
152
|
-
<li><a href="/">
|
|
153
|
-
<li><a href="/">
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
<
|
|
188
|
-
<
|
|
189
|
-
<
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
</
|
|
193
|
-
|
|
194
|
-
</li>
|
|
195
|
-
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
</div>
|
|
231
|
-
</ilw-header-megamenu-section>
|
|
232
|
-
</li>
|
|
233
|
-
</ul>
|
|
234
|
-
</ilw-header-megamenu>
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
## Usability
|
|
238
|
-
When creating menus, do not include all your links inside the menu. Just focus on the high-level links, and rely on breadcrumbs and side menus for internal links. Having a large menu system reduces usability.
|
|
239
|
-
|
|
240
|
-
While it is tempting to hide your menu with the hamburger menu option, only do this if you have no other option. Hamburger menus harm usability because it hides the top-level categories and reduces the ability for users to browse to find what they want, especially for new users.
|
|
241
|
-
|
|
242
|
-
## Accessibility Notes and Use
|
|
243
|
-
|
|
244
|
-
Note from Keith:
|
|
245
|
-
- Navigation / Menus are unique in that most screen reader users will only expect linked items to exist inside of this element role. This means that any headings or static text should be avoided since they will likely be missed by this audience.
|
|
246
|
-
|
|
247
|
-
### Keyboard navigation
|
|
248
|
-
- While all dropdowns are closed: Use `Tab/Shift + Tab` or `left/right arrow keys` move the user across the top level navigation bar.
|
|
249
|
-
- Open a dropdown: Focus on the toggle button and press `enter` or `space`.
|
|
250
|
-
- Navigate an open dropdown: `Tab/Shift + Tab` or `down/up arrow keys` will go down/up the list.
|
|
251
|
-
- Close an open dropdown: Click anywhere else on the screen, press `escape` to close and return focus to the corresponding toggle button or hitting the `Left/right arrow keys` will close the dropdown and go to the next item in the top level navigation bar.
|
|
252
|
-
- Focus stays on the same menu item when the browser changes sizes to switch between mega and hamburger menu
|
|
253
|
-
|
|
254
|
-
### ARIA
|
|
255
|
-
- Each toggle button will get the attributes: `aria-haspopup="true"`, `aria-expanded="true"`, `aria-controls="parent-name-menu"` and `aria-label="Toggle parent-name submenu`. The SVG will get `aria-hidden="true"`
|
|
256
|
-
- Each section will get a unique id and label, example: `id="parent-name-menu"` and `aria-label="About submenu"`
|
|
257
|
-
- For call to action items, the paragraph will get: `id="parent-name-action-text"` and the clickable element will receive `aria-describedby="parent-name-action-text"`.
|
|
258
|
-
|
|
259
|
-
## External References
|
|
260
|
-
|
|
261
|
-
See [ilw-header-menu documentation](https://github.com/web-illinois/ilw-header-menu)
|
|
1
|
+
# ilw-header-megamenu
|
|
2
|
+
|
|
3
|
+
Links: **[ilw-header-megamenu in Builder](https://builder3.toolkit.illinois.edu/component/ilw-header-megamenu/index.html)** |
|
|
4
|
+
[Illinois Web Theme](https://webtheme.illinois.edu/) |
|
|
5
|
+
[Toolkit Development](https://github.com/web-illinois/toolkit-management)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
An Illinois Mega Menu utilizes the standard design of the header menu, limited to only dropdown labels or singular links for top level items, no link combination toggles. The dropdown itself takes up the full-width of the container maxing out at 1270px, slightly exceeding the length of the main nav bar items. Each dropdown section has a maximum of 4 columns, evenly spaced with a diving bar between each.
|
|
10
|
+
|
|
11
|
+
The Mega Menu is not suited for more than 1 layer of nested lists, if you require more, use the original ilw-header-menu with nested ilw-header-menu-sections instead (flyout menu).
|
|
12
|
+
|
|
13
|
+
---------
|
|
14
|
+
|
|
15
|
+
The ilw-header-megamenu should contain an unordered list. Each list item can contain one of three items:
|
|
16
|
+
|
|
17
|
+
- a simple link or button (`<a>` or `<button>`)
|
|
18
|
+
- an <ilw-header-megamenu-section> that contains a span and at least one unordered list of links. The span should contain `slot="label"`.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Within each `ilw-header-megamenu-section` you can choose:
|
|
22
|
+
- a basic unordered list of less than 20 links and no nesting. Each list item will be divided into groups of 5 or less. Adding more than 20 items will result in missing links. To make a solo-list use `class="solo-list"` otherwise you will get a list that only fills the first column.
|
|
23
|
+
OR
|
|
24
|
+
- four seperated lists of links with nesting. Each new list will become it's own column. You can have as many list items within a list as you need using this method. Note that this has been specifically designed for a maximum of four columns, using more than four lists is *not advised* and will result in wrapped columns.
|
|
25
|
+
|
|
26
|
+
Optional action-left and action-right slots can contain:
|
|
27
|
+
- a decorative image
|
|
28
|
+
- a `<span>` containing a paragraph element and a `<button>`. The span should contain `slot="action-left"` or `slot="action-right"` depending on where you'd like it to be placed. Only a single left or right slots can be used, if two are entered only left will appear. Note that any combination of items spanning more than four columns can result in wrapped columns and is an unintended use.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## Attributes
|
|
32
|
+
|
|
33
|
+
`width`: the numeric pixel width where it will change to the hamburger menu. This is defaulted to 990, but may be changed if you have a ridiculous menu.
|
|
34
|
+
`compact`: a boolean value that will force the menu to be a hamburger menu. Before using this option, see Accessibility Notes and Use for more information.
|
|
35
|
+
|
|
36
|
+
## Classes
|
|
37
|
+
`solo-list`: allows you to have a single list with a fixed background height and fills up the 4 columns, maxing out at 20 items with no nesting
|
|
38
|
+
`span-2`: allows your secondary item to span 2 columns
|
|
39
|
+
`span-3`: allows your secondary item to span 3 columns
|
|
40
|
+
|
|
41
|
+
## Code Examples
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<ilw-header-megamenu slot="navigation">
|
|
45
|
+
<ul>
|
|
46
|
+
<li>
|
|
47
|
+
<ilw-header-megamenu-section class="solo-list">
|
|
48
|
+
<span slot="label">Single Unordered List</span>
|
|
49
|
+
<ul>
|
|
50
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
51
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
52
|
+
<li><a href="/">International Admissions</a></li>
|
|
53
|
+
<li><a href="/">Degrees</a></li>
|
|
54
|
+
<li><a href="/">Certificates</a></li>
|
|
55
|
+
<li><a href="/">Online Programs</a></li>
|
|
56
|
+
<li><a href="/">Research Focus Areas</a></li>
|
|
57
|
+
<li><a href="/">Find a mentor</a></li>
|
|
58
|
+
<li><a href="/">Degrees</a></li>
|
|
59
|
+
<li><a href="/">Certificates</a></li>
|
|
60
|
+
<li><a href="/">Online Programs</a></li>
|
|
61
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
62
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
63
|
+
<li><a href="/">Online Programs</a></li>
|
|
64
|
+
<li><a href="/">Research Focus Areas</a></li>
|
|
65
|
+
<li><a href="/">Find a mentor</a></li>
|
|
66
|
+
<li><a href="/">Degrees</a></li>
|
|
67
|
+
<li><a href="/">Certificates</a></li>
|
|
68
|
+
<li><a href="/">Online Programs</a></li>
|
|
69
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
70
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
71
|
+
</ul>
|
|
72
|
+
</ilw-header-megamenu-section>
|
|
73
|
+
</li>
|
|
74
|
+
<li>
|
|
75
|
+
<ilw-header-megamenu-section>
|
|
76
|
+
<span slot="label">Distinct Columns</span>
|
|
77
|
+
<ul>
|
|
78
|
+
<li><a href="/">Undergrad Admissions</a>
|
|
79
|
+
<ul>
|
|
80
|
+
<li><a href="/">Apply</a></li>
|
|
81
|
+
<li><a href="/">Majors</a></li>
|
|
82
|
+
<li><a href="/">Cost and Aid</a></li>
|
|
83
|
+
</ul>
|
|
84
|
+
</li>
|
|
85
|
+
<li><a href="/">Graduate Admissions</a>
|
|
86
|
+
<ul>
|
|
87
|
+
<li><a href="/">Apply</a></li>
|
|
88
|
+
<li><a href="/">Majors</a></li>
|
|
89
|
+
<li><a href="/">Cost and Aid</a></li>
|
|
90
|
+
</ul>
|
|
91
|
+
</li>
|
|
92
|
+
<li><a href="/">International Admissions</a></li>
|
|
93
|
+
</ul>
|
|
94
|
+
<ul>
|
|
95
|
+
<li><a href="/">Degrees</a></li>
|
|
96
|
+
<li><a href="/">Certificates</a></li>
|
|
97
|
+
<li><a href="/">Online Programs</a></li>
|
|
98
|
+
</ul>
|
|
99
|
+
<ul>
|
|
100
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
101
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
102
|
+
<li><a href="/">International Admissions</a>
|
|
103
|
+
<ul>
|
|
104
|
+
<li><a href="/">Degrees</a></li>
|
|
105
|
+
<li><a href="/">Certificates</a></li>
|
|
106
|
+
<li><a href="/">Online Programs</a></li>
|
|
107
|
+
<li><a href="/">Research Focus Areas</a></li>
|
|
108
|
+
</ul>
|
|
109
|
+
</li>
|
|
110
|
+
<li><a href="/">Find a mentor</a></li>
|
|
111
|
+
<li><a href="/">Student Handbook</a></li>
|
|
112
|
+
</ul>
|
|
113
|
+
<ul>
|
|
114
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
115
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
116
|
+
<li><a href="/">International Admissions</a>
|
|
117
|
+
<ul>
|
|
118
|
+
<li><a href="/">Degrees</a></li>
|
|
119
|
+
<li><a href="/">Certificates</a></li>
|
|
120
|
+
<li><a href="/">Online Programs</a></li>
|
|
121
|
+
<li><a href="/">Research Focus Areas</a></li>
|
|
122
|
+
</ul>
|
|
123
|
+
</li>
|
|
124
|
+
</ul>
|
|
125
|
+
</ilw-header-megamenu-section>
|
|
126
|
+
</li>
|
|
127
|
+
<li>
|
|
128
|
+
<ilw-header-megamenu-section>
|
|
129
|
+
<span slot="label">Decorative Image</span>
|
|
130
|
+
<ul>
|
|
131
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
132
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
133
|
+
<li><a href="/">International Admissions</a></li>
|
|
134
|
+
<li><a href="/">Degrees</a></li>
|
|
135
|
+
<li><a href="/">Certificates</a></li>
|
|
136
|
+
</ul>
|
|
137
|
+
<span slot="action-left" >
|
|
138
|
+
<img src="https://fastly.picsum.photos/id/1025/500/400.jpg?hmac=MPFZjsU2UG1Mr3SjMkYP2F9jnhQWyatt6soxbOj0TN4" alt="">
|
|
139
|
+
</span>
|
|
140
|
+
</ilw-header-megamenu-section>
|
|
141
|
+
</li>
|
|
142
|
+
<li>
|
|
143
|
+
<ilw-header-megamenu-section>
|
|
144
|
+
<span slot="label">CTA with image</span>
|
|
145
|
+
<ul>
|
|
146
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
147
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
148
|
+
<li><a href="/">International Admissions</a>
|
|
149
|
+
<ul>
|
|
150
|
+
<li><a href="/">Degrees</a></li>
|
|
151
|
+
<li><a href="/">Certificates</a></li>
|
|
152
|
+
<li><a href="/">Online Programs</a></li>
|
|
153
|
+
<li><a href="/">Research Focus Areas</a></li>
|
|
154
|
+
</ul>
|
|
155
|
+
</li>
|
|
156
|
+
<li><a href="/">Find a mentor</a></li>
|
|
157
|
+
<li><a href="/">Student Handbook</a></li>
|
|
158
|
+
</ul>
|
|
159
|
+
<span slot="action-left" class="span-3">
|
|
160
|
+
<p> Prospective students </p>
|
|
161
|
+
<button class="ilw-button ilw-theme-orange-1">Link 2</button>
|
|
162
|
+
<img src="https://picsum.photos/id/37/300/300" alt="">
|
|
163
|
+
</span>
|
|
164
|
+
</ilw-header-megamenu-section>
|
|
165
|
+
</li>
|
|
166
|
+
<li>
|
|
167
|
+
<ilw-header-megamenu-section>
|
|
168
|
+
<span slot="label">Plain CTA</span>
|
|
169
|
+
<ul>
|
|
170
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
171
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
172
|
+
<li><a href="/">International Admissions</a></li>
|
|
173
|
+
<li><a href="/">Degrees</a></li>
|
|
174
|
+
<li><a href="/">Certificates</a></li>
|
|
175
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
176
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
177
|
+
<li><a href="/">International Admissions</a></li>
|
|
178
|
+
<li><a href="/">Degrees</a></li>
|
|
179
|
+
<li><a href="/">Certificates</a></li>
|
|
180
|
+
</ul>
|
|
181
|
+
<ul>
|
|
182
|
+
<li><a href="/">Undergrad Admissions</a></li>
|
|
183
|
+
<li><a href="/">Graduate Admissions</a></li>
|
|
184
|
+
<li><a href="/">International Admissions</a>
|
|
185
|
+
<ul>
|
|
186
|
+
<li><a href="/">Degrees</a></li>
|
|
187
|
+
<li><a href="/">Certificates</a></li>
|
|
188
|
+
<li><a href="/">Online Programs</a></li>
|
|
189
|
+
<li><a href="/">Research Focus Areas</a>
|
|
190
|
+
</li>
|
|
191
|
+
</ul>
|
|
192
|
+
</li>
|
|
193
|
+
<li><a href="/">Find a mentor</a></li>
|
|
194
|
+
<li><a href="/">Student Handbook</a></li>
|
|
195
|
+
</ul>
|
|
196
|
+
<span slot="action-right" class="span-2">
|
|
197
|
+
<p> Prospective students </p>
|
|
198
|
+
<button class="ilw-button ilw-theme-orange-1">Link 2</button>
|
|
199
|
+
</span>
|
|
200
|
+
</ilw-header-megamenu-section>
|
|
201
|
+
</li>
|
|
202
|
+
</ul>
|
|
203
|
+
</ilw-header-megamenu>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Usability
|
|
207
|
+
When creating menus, do not include all your links inside the menu. Just focus on the high-level links, and rely on breadcrumbs and side menus for internal links. Having a large menu system reduces usability.
|
|
208
|
+
|
|
209
|
+
While it is tempting to hide your menu with the hamburger menu option, only do this if you have no other option. Hamburger menus harm usability because it hides the top-level categories and reduces the ability for users to browse to find what they want, especially for new users.
|
|
210
|
+
|
|
211
|
+
## Accessibility Notes and Use
|
|
212
|
+
|
|
213
|
+
Note from Keith:
|
|
214
|
+
- Navigation / Menus are unique in that most screen reader users will only expect linked items to exist inside of this element role. This means that any headings or static text should be avoided since they will likely be missed by this audience.
|
|
215
|
+
|
|
216
|
+
### Keyboard navigation
|
|
217
|
+
- While all dropdowns are closed: Use `Tab/Shift + Tab` or `left/right arrow keys` move the user across the top level navigation bar.
|
|
218
|
+
- Open a dropdown: Focus on the toggle button and press `enter` or `space`.
|
|
219
|
+
- Navigate an open dropdown: `Tab/Shift + Tab` or `down/up arrow keys` will go down/up the list.
|
|
220
|
+
- Close an open dropdown: Click anywhere else on the screen, press `escape` to close and return focus to the corresponding toggle button or hitting the `Left/right arrow keys` will close the dropdown and go to the next item in the top level navigation bar.
|
|
221
|
+
- Focus stays on the same menu item when the browser changes sizes to switch between mega and hamburger menu
|
|
222
|
+
|
|
223
|
+
### ARIA
|
|
224
|
+
- Each toggle button will get the attributes: `aria-haspopup="true"`, `aria-expanded="true"`, `aria-controls="parent-name-menu"` and `aria-label="parent-name submenu`. The SVG will get `aria-hidden="true"`
|
|
225
|
+
- For call to action items, the paragraph will get: `id="parent-name-action-text"` and the clickable element will receive `aria-describedby="parent-name-action-text"`.
|
|
226
|
+
|
|
227
|
+
## External References
|
|
228
|
+
|
|
229
|
+
See [ilw-header-menu documentation](https://github.com/web-illinois/ilw-header-menu)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "Header Mega Menu",
|
|
3
|
-
"tag": "ilw-header-megamenu",
|
|
4
|
-
"github": "https://github.com/web-illinois/ilw-header-megamenu/",
|
|
5
|
-
"type": "web component",
|
|
6
|
-
"element-name": "ilw-header-megamenu",
|
|
7
|
-
"description": "Mega Menu for the top of the page.",
|
|
8
|
-
"purpose": "Build a mega menu navigation",
|
|
9
|
-
"toolkit-version": "",
|
|
10
|
-
"production-version": "",
|
|
11
|
-
"development-version": "latest"
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"title": "Header Mega Menu",
|
|
3
|
+
"tag": "ilw-header-megamenu",
|
|
4
|
+
"github": "https://github.com/web-illinois/ilw-header-megamenu/",
|
|
5
|
+
"type": "web component",
|
|
6
|
+
"element-name": "ilw-header-megamenu",
|
|
7
|
+
"description": "Mega Menu for the top of the page.",
|
|
8
|
+
"purpose": "Build a mega menu navigation",
|
|
9
|
+
"toolkit-version": "1.0.1",
|
|
10
|
+
"production-version": "1.0.1",
|
|
11
|
+
"development-version": "latest"
|
|
12
|
+
}
|