Lenra Docs
Register on Lenra
  • Home
  • Getting started
    Open/Close
  • Guides
    Open/Close
  • Features
    Open/Close
  • References
    Open/Close
  • MenuItemContribute

    This component is made to be used with the menu component. This will ensure that the styling is correct and that the menu items are properly sized.

    Examples

    Simple menuItem

    {
        "type": "menuItem",
        "text": "Simple menuItem",
    }
    

    MenuItem icon & on pressed

    But you can customize the look of your items or set an action like in any other actionable.

    {
        "type": "menuItem",
        "text": "Menu Item",
        "icon": {
            "type": "icon",
            "value": "abc",
        },
        "onPressed": {
            "action": "pressed"
        }
    }
    

    Properties

    AttributeDescriptionType
    typeThe type of the element
    • menuItem
    textThe text of the elementstring
    disabledWhether the element should be disabled or not.boolean
    iconThe Icon to useIcon
    isSelectedWhether the element is selected or not.boolean
    onPressedListener