MdMenu

open class MdMenu(anchor: String? = null, positioning: MenuPositioning = MenuPositioning.Absolute, quick: Boolean = false, hasOverflow: Boolean = false, xOffset: Int = 0, yOffset: Int = 0, typeaheadDelay: Int = DEFAULT_TYPEAHEAD_DELAY, anchorCorner: Corner = Corner.EndStart, corner: Corner = Corner.StartStart, stayOpenOnOutsideClick: Boolean = false, stayOpenOnFocusout: Boolean = false, skipRestoreFocus: Boolean = false, defaultFocus: FocusState = FocusState.FirstItem, noNavigationWrap: Boolean = false, className: String? = null, init: MdMenu.() -> Unit? = null) : MdListContainer<MdMenuItem>

Menus display a list of choices on a temporary surface.

See https://material-web.dev/components/menu/

Author

Maanrifa Bacar Ali

Constructors

Link copied to clipboard
constructor(anchor: String? = null, positioning: MenuPositioning = MenuPositioning.Absolute, quick: Boolean = false, hasOverflow: Boolean = false, xOffset: Int = 0, yOffset: Int = 0, typeaheadDelay: Int = DEFAULT_TYPEAHEAD_DELAY, anchorCorner: Corner = Corner.EndStart, corner: Corner = Corner.StartStart, stayOpenOnOutsideClick: Boolean = false, stayOpenOnFocusout: Boolean = false, skipRestoreFocus: Boolean = false, defaultFocus: FocusState = FocusState.FirstItem, noNavigationWrap: Boolean = false, className: String? = null, init: MdMenu.() -> Unit? = null)

Properties

Link copied to clipboard
var anchor: <Error class: unknown class>

The ID of the element in the same root node in which the menu should align to. Overrides setting anchorElement = elementReference.

Link copied to clipboard
var anchorCorner: <Error class: unknown class>

The corner of the anchor which to align the menu in the standard logical property style of - e.g. 'end-start'.

Link copied to clipboard
var defaultFocus: <Error class: unknown class>

The element that should be focused by default once opened.

Link copied to clipboard
var hasOverflow: <Error class: unknown class>

Displays overflow content like a submenu. Not required in most cases when positioning is MenuPositioning.Popover.

Link copied to clipboard

Gets the direct items in this list.

Link copied to clipboard
var menuCorner: <Error class: unknown class>

The corner of the menu which to align the anchor in the standard logical property style of - e.g. 'start-start'.

Link copied to clipboard
var noNavigationWrap: <Error class: unknown class>

Turns off navigation wrapping. By default, navigating past the end of the menu items will wrap focus back to the beginning and vice versa. Use this for ARIA patterns that do not wrap focus, like combobox.

Link copied to clipboard

Indicates that the menu is in an open state.

Link copied to clipboard
var positioning: <Error class: unknown class>

Whether the positioning algorithim should calculate relative to the parent of the anchor element (absolute) or relative to the window (fixed).

Link copied to clipboard
var quick: <Error class: unknown class>

Skips the opening and closing animations.

Link copied to clipboard
var skipRestoreFocus: <Error class: unknown class>

After closing, does not restore focus to the last focused element before the menu was opened.

Link copied to clipboard
var stayOpenOnFocusout: <Error class: unknown class>

Keeps the menu open when focus leaves the menu's composed subtree.

Link copied to clipboard
var stayOpenOnOutsideClick: <Error class: unknown class>

Keeps the user clicks outside the menu.

Link copied to clipboard
var typeaheadDelay: <Error class: unknown class>

The max time between the keystrokes of the typeahead menu behavior before it clears the typeahead buffer.

Link copied to clipboard
var xOffset: <Error class: unknown class>

Offsets the menu's inline alignment from the anchor by the given number in pixels. This value is direction aware and will follow the LTR / RTL direction.

Link copied to clipboard
var yOffset: <Error class: unknown class>

Offsets the menu's block alignment from the anchor by the given number in pixels.

Functions

Link copied to clipboard

Activates the next item in the list. If at the end of the list, the first item will be activated.

Link copied to clipboard

Activates the previous item in the list. If at the start of the list, the last item will be activated.

Link copied to clipboard
open fun buildAttributeSet(attributeSetBuilder: <Error class: unknown class>)
Link copied to clipboard
fun close()

Closes the menu.

Link copied to clipboard
fun MdMenu.menuItem(disabled: Boolean = false, type: MenuItemType = MenuItemType.MenuItem, href: String? = null, target: LinkTarget? = null, keepOpen: Boolean = false, selected: Boolean = false, typeaheadText: String? = null, className: String? = null, init: MdMenuItem.() -> Unit? = null): <Error class: unknown class>
Link copied to clipboard
fun open()

Shows the menu.

Link copied to clipboard
open fun render(): <Error class: unknown class>
Link copied to clipboard
fun MdMenu.submenu(anchorCorner: Corner = Corner.EndStart, corner: Corner = Corner.StartStart, hoverOpenDelay: Int = DEFAULT_HOVER_OPEN_DELAY, hoverCloseDelay: Int = DEFAULT_HOVER_CLOSE_DELAY, className: String? = null, init: MdSubMenu.() -> Unit? = null): <Error class: unknown class>
Link copied to clipboard
fun toggle()

Toggles the menu open state.