Code example

The drop menu needs to be used in combination with a type of button, usually an ox-button--plain ox-button--icon-small with a vertical ellipsis in it.

To separate dropmenu items into different groups you can add the class ox-dropmenu__option--separator to the first item of the group. If one or multiple items need to be highlighted (e.g. a delete option), we've also added classes for all the functional colors such as ox-dropmenu__option--error.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<div class="ox-card">
	<div class="ox-card__content ox-text--right">
		<div class="ox-dropmenu-wrapper" id="dox-drop-menu-example" aria-haspopup="true" aria-expanded="false">
			<input type="checkbox" class="ox-dropmenu-toggle" id="toggle-dropmenu">
			<label for="toggle-dropmenu" class="ox-dropmenu__trigger ox-button ox-button--plain ox-button--icon-small" role="button" aria-label="Toggle dropmenu">
				<span class="ox-icon ox-icon--ellipsis-vertical"></span>
			</label>
			<div class="ox-dropmenu">
				<ul class="ox-dropmenu__list" tabindex="-1" role="menu" aria-label="Overflow" data-floating-menu-direction="bottom">
					<li class="ox-dropmenu__option" role="presentation">
						<a href="#" class="ox-dropmenu__option__button" role="menuitem">
							<span class="ox-dropmenu__option__icon ox-icon ox-icon--calendar"></span>
							View detail
						</a>
					</li>
					<li class="ox-dropmenu__option" role="presentation">
						<a href="#" class="ox-dropmenu__option__button" role="menuitem">
							<span class="ox-dropmenu__option__icon ox-icon ox-icon--edit"></span>
							Edit item
						</a>
					</li>
					<li class="ox-dropmenu__option ox-dropmenu__option--separator ox-dropmenu__option--error" role="presentation">
						<button type="button" class="ox-dropmenu__option__button" role="menuitem">
							<span class="ox-dropmenu__option__icon ox-icon ox-icon--close"></span>
							Delete item
						</button>
					</li>
				</ul>
			</div>
		</div>
	</div>
</div>

When using the drop menu in the header, you should use the ox-button ox-button--primary-on-primary ox-button--icon-small, the rest of the code is the same as the previous example.

Usually a dropmenu in the header is used to show account navigation links or similar things. For spacing reasons the best thing to do is add the class ox-show-large-up to the wrapper to hide the drop menu on smaller screens. On smaller screens you can add the account links to the main navigation as shown in the horizontal layout.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<header class="ox-layout__header" role="banner">
	<div class="ox-header-container">
		<a href="/" class="ox-header__site-name">OX</a>
		<div class="ox-dropmenu-wrapper" id="dox-drop-menu-example-2" aria-haspopup="true" aria-expanded="false">
			<input type="checkbox" class="ox-dropmenu-toggle" id="toggle-dropmenu-2">
			<label for="toggle-dropmenu-2" class="ox-dropmenu__trigger ox-button ox-button--secondary ox-button--icon-small" role="button" aria-label="Toggle dropmenu">
				<span class="ox-icon ox-icon--user"></span>
			</label>
			<div class="ox-dropmenu">
				<ul class="ox-dropmenu__list" tabindex="-1" role="menu" aria-label="Overflow" data-floating-menu-direction="bottom">
					<li class="ox-dropmenu__option" role="presentation">
						<a href="#" class="ox-dropmenu__option__button" role="menuitem">
							<span class="ox-dropmenu__option__icon ox-icon ox-icon--settings"></span>
							Settings
						</a>
					</li>
					<li class="ox-dropmenu__option ox-dropmenu__option--separator ox-dropmenu__option--error" role="presentation">
						<button class="ox-dropmenu__option__button" role="menuitem">
							<span class="ox-dropmenu__option__icon ox-icon ox-icon--power"></span>
							Log out
						</button>
					</li>
				</ul>
			</div>
		</div>
	</div>
</header>