Skip to content

[styleguide] Popover menu #2798

@skjnldsv

Description

@skjnldsv

This is a styleguide post. We will discuss the proper way to integrate a specific design part of nextcloud and then integrate it in the documentations.

@jancborchardt @nextcloud/designers

What is a popover menu

This is a quick menu that open on click. We're usually using the three dots icons on nextcloud.
This menu currently differs from the navigation menu on the app-navigation section on the left. We should definitely merge those two and make one single way to create a popover menu on nextcloud (see app-navigation-entry-menu class on css files)

Summary

  1. In nextcloud we only want icons or icons+text
  2. Two orientation:
    • Horizontal: for icons only
    • Vertical: for icon+text
  3. The menu is aligned on the three-dot icons it refers to

Proposition

Html structure

<div class="popovermenu">
	<ul>
		<li>
			<a href="#" class="icon-details">
				<span>Details</span>
			</a>
		</li>
		<li>
			<button class="icon-details">
				<span>Details</span>
			</button>
		</li>
		<li>
			<button>
				<span class="icon-details"></span><span>Details</span>
			</button>
		</li>
		<li>
			<a>
				<span class="icon-details"></span><span>Details</span>
			</a>
		</li>
	<ul>
</div>

Technical details

  1. The only allowed menu items elements are a and button
  2. You can mix between a and button on the same menu (in case of form or direct link)
  3. If you want your menu to be horizontal, you need to set the icon class to your a/button and not use span inside.
  4. You need to put the entire menu just after the three dot icon (refs Fix popover width #2545 (comment))
    • <div><span class="icon-more"></span><div class="popovermenu">...</div></div>
    • With this, we don't need js, css only is ok for positioning.
    • The required right distance to the border (or padding, whatever you want to use) of the three-dot icon should be 14px (5 for menu margin and 6 for arrow position)
  5. Don't put ul next to each other like the mail app, this is a wrong way to do.

Suggestions

  1. Should we add the possibility to display the popover towards the top? Right now it is only set as "to the bottom"
  • Should we add the option to select the arrow alignement? Right now this is only aligned on the right of the popup.
    • You can now have fun with menu-center and menu-left for alignment.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions