Popup Menu Item
Popup Menu Item is used to add items to menus created with Popup Menu
Properties #
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
accessibleLabel | accessible-label | Adds accessible label for the button or link that is only shown for screen readers. Typically, this label text replaces the visible text on the button for users who use assistive technology. | string | undefined |
accessibleRole | accessible-role | Accessible role. | "listitem" | "menuitem" | "menuitem" |
active | active | Is the item currently active (e.g. selected) | boolean | false |
external | external | Forces URL to open in a new browser tab. Used together with URL prop. | boolean | false |
leadingIcon | leading-icon | Left icon. | string | undefined |
leadingIconColor | leading-icon-color | Left icon color. | string | undefined |
targetLanguage | target-language | Language of the link. Use this only for language selection links. | "en" | "fi" | "sv" | undefined |
theme | theme | Theme. | "" | "default" | "turva" | "" |
trailingIcon | trailing-icon | Right icon. | string | undefined |
trailingText | trailing-text | Short text to display after the label, e.g. keyboard shortcut. | string | undefined |
url | url | A destination to link to, rendered in the href attribute of a link. | string | undefined |
value | value | Value | string | undefined |
Events #
Event | Description | Type |
---|---|---|
duetBlur | Emitted when the item loses focus. | CustomEvent<{ originalEvent?: Event; value: string; component: "duet-popup-menu-item"; }> |
duetFocus | Emitted when the item receives focus. | CustomEvent<{ originalEvent?: Event; value: string; component: "duet-popup-menu-item"; }> |
Methods #
isFocused() => Promise<boolean>
#
isFocused.
Returns #
Type: Promise<boolean>
setFocus(options?: FocusOptions) => Promise<void>
#
Sets focus. Use this method instead of the global focus().
Parameters #
Name | Type | Description |
---|---|---|
options | FocusOptions |
Returns #
Type: Promise<void>
Usage #
This section includes guidelines for designers and developers about the usage of this component in different contexts.
When to use #
- When you want to add items to a Popup Menu.
When not to use #
- If you are not using Popup Menu.
Accessibility #
This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.
- Underlying component has
menuitem
role which marks the component as a menuitem for screen readers. - It can be activated with keyboard.
Integration
For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.
Tutorials
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Building Layouts
TutorialsUsing CLI Tools
TutorialsCreating Custom Patterns
TutorialsServer Side Rendering
TutorialsSharing Prototypes
TutorialsUsage With Markdown
Troubleshooting
If you experience any issues while using a component, please head over to the Support page for more guidelines and help.