Popover menu
Popover menu
Component demo
Interactive example
<ic-buttonid="button-1"variant="icon"title="More information"onclick="handleClick()"aria-expanded="false"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="currentColor"class="bi bi-three-dots-vertical"viewBox="0 0 16 16"><pathd="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg></ic-button><div><ic-popover-menuanchor="button-1"aria-label="popover"id="popover-menu"><ic-menu-itemlabel="Copy code"></ic-menu-item><ic-menu-itemlabel="Paste code"></ic-menu-item><ic-menu-itemlabel="Actions"submenu-trigger-for="actions"></ic-menu-item></ic-popover-menu><ic-popover-menusubmenu-id="actions"><ic-menu-itemlabel="Edit"></ic-menu-item><ic-menu-itemlabel="Find"></ic-menu-item><ic-menu-itemlabel="Delete"variant="destructive"></ic-menu-item></ic-popover-menu></div>
<IcButtonvariant="icon"title="More information"id="button-1"onClick={handlePopoverToggled}aria-expanded={popoverOpen}><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="currentColor"class="bi bi-three-dots-vertical"viewBox="0 0 16 16"><pathd="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></SlottedSVG></IcButton><IcPopoverMenuanchor="button-1"aria-label="popover"open={popoverOpen}onIcPopoverClosed={handlePopoverClosed}><IcMenuItemlabel="Copy code"/><IcMenuItemlabel="Paste code"/><IcMenuItemlabel="Actions"submenuTriggerFor="actions"/></IcPopoverMenu><IcPopoverMenusubmenuId="actions"aria-label="popover"><IcMenuItemlabel="Edit"/><IcMenuItemlabel="Find"/><IcMenuItemlabel="Delete"variant="destructive"/></IcPopoverMenu>
Popover menu details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The ID of the element the popover menu will anchor itself to. This is required unless the popover is a submenu. |
|
|
If |
|
|
The unique identifier for a popover submenu. |
|
The ID of the element the popover menu will anchor itself to. This is required unless the popover is a submenu. |
If |
The unique identifier for a popover submenu. |
CSS Custom Properties
|
|
---|---|
|
|
|
|
|
|
|
|
|
Events
All components also accept native events supported by the DOM, such as
onClick
and
onKeyDown
.
|
|
|
---|---|---|
|
|
|
|
Menu item details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The label to display in the menu item. |
|
|
The description displayed in the menu item, below the label. |
|
|
If |
|
|
The URL that the link points to. This will render the menu item as an "a" tag. |
|
|
The human language of the linked URL. |
|
|
The label describing the keyboard shortcut for a menu item's action. |
|
|
How much of the referrer to send when following the link. |
|
|
The relationship of the linked URL as space-separated link types. |
|
|
This references the popover menu instance that the menu item is a trigger for. If this prop is set, then the variant will always be default. |
|
|
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
|
|
If |
|
|
The variant of the menu item. |
|
The label to display in the menu item. |
The description displayed in the menu item, below the label. |
If |
The URL that the link points to. This will render the menu item as an "a" tag. |
The human language of the linked URL. |
The label describing the keyboard shortcut for a menu item's action. |
How much of the referrer to send when following the link. |
The relationship of the linked URL as space-separated link types. |
This references the popover menu instance that the menu item is a trigger for. If this prop is set, then the variant will always be default. |
The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe). |
If |
The variant of the menu item. |
Slots
A slot allows for any type of element or markup to be passed into and rendered within a web component. This creates more flexibility than using a prop which must take a specific type of data.
Content can be slotted into a component by adding it as a top-level child of the component.
Slots can have a name to identify them. These specify which slot the content will be inserted into, and therefore where it will be rendered and how it will be used within the component. The name of the slot to be used can be specified by passing it via a
slot
attribute on the slotted content.
|
|
---|---|
|
|
|
Events
All components also accept native events supported by the DOM, such as
onClick
and
onKeyDown
.
|
|
|
---|---|---|
|
|
|
|
Menu group details
Props
All components also accept native properties supported by the DOM, such asclassName
and
style
.
|
|
|
---|---|---|
|
The label to display as the title of the menu group. |
|
The label to display as the title of the menu group. |
Variants
With button variations
Interactive example
<ic-buttonid="button-2"variant="icon"title="More information"onclick="handleClick()"aria-expanded="false"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="currentColor"class="bi bi-three-dots-vertical"viewBox="0 0 16 16"><pathd="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg></ic-button><div><ic-popover-menuanchor="button-2"aria-label="popover"id="popover-menu-2"><ic-menu-itemlabel="Copy"disabled="true"></ic-menu-item><ic-menu-itemlabel="Paste"keyboard-shortcut="Cmd + V"></ic-menu-item><ic-menu-itemlabel="Edit"description="This is used to edit the original."></ic-menu-item><ic-menu-itemlabel="Show/Hide"variant="toggle"></ic-menu-item><ic-menu-itemlabel="Find icons"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></svg></ic-menu-item><ic-menu-itemlabel="Delete"disabled="true"variant="destructive"></ic-menu-item><ic-menu-itemlabel="Log out"variant="destructive"></ic-menu-item></ic-popover-menu></div>
<IcButtonvariant="icon"title="More information"id="button-2"onClick={handlePopoverToggled}aria-expanded={popoverOpen}><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="currentColor"class="bi bi-three-dots-vertical"viewBox="0 0 16 16"><pathd="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></SlottedSVG></IcButton><IcPopoverMenuanchor="button-2"aria-label="popover"open={popoverOpen}onIcPopoverClosed={handlePopoverClosed}><IcMenuItemlabel="Copy"disabled/><IcMenuItemlabel="Paste"keyboardShortcut="Cmd + V"/><IcMenuItemlabel="Edit"description="This is used to edit the original."/><IcMenuItemlabel="Show/Hide"variant="toggle"/><IcMenuItemlabel="Find icons"><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"height="24"viewBox="0 0 24 24"width="24"><pathd="M0 0h24v24H0V0z"fill="none"/><pathd="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/></SlottedSVG></IcMenuItem><IcMenuItemlabel="Delete"disabledvariant="destructive"/><IcMenuItemlabel="Log out"variant="destructive"/></IcPopoverMenu>
With menu groups
Interactive example
<ic-buttonid="button-3"variant="icon"title="More information"onclick="handleClick()"aria-expanded="false"><svgslot="icon"xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="currentColor"class="bi bi-three-dots-vertical"viewBox="0 0 16 16"><pathd="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></svg></ic-button><div><ic-popover-menuanchor="button-3"aria-label="popover"id="popover-menu-3"><ic-menu-grouplabel="Edit options"><ic-menu-itemlabel="Copy"disabled="true"></ic-menu-item><ic-menu-itemlabel="Paste"keyboard-shortcut="Cmd + V"></ic-menu-item></ic-menu-group><ic-menu-group><ic-menu-itemlabel="Format"></ic-menu-item><ic-menu-itemlabel="Help"></ic-menu-item></ic-menu-group></ic-popover-menu></div>
<IcButtonvariant="icon"title="More information"id="button-3"onClick={handlePopoverToggled}aria-expanded={popoverOpen}><SlottedSVGslot="icon"xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="currentColor"class="bi bi-three-dots-vertical"viewBox="0 0 16 16"><pathd="M9.5 13a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm0-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z"/></SlottedSVG></IcButton><IcPopoverMenuanchor="button-3"aria-label="popover"open={popoverOpen}onIcPopoverClosed={handlePopoverClosed}><IcMenuGrouplabel="Edit options"><IcMenuItemlabel="Copy"disabled/><IcMenuItemlabel="Paste"keyboardShortcut="Cmd + V"/></IcMenuGroup><IcMenuGroup><IcMenuItemlabel="Format"/><IcMenuItemlabel="Help"/></IcMenuGroup></IcPopoverMenu>