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

    MenuItem

    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 listener like in any other actionable.

    {
        "type": "menuItem",
        "text": "Menu Item",
        "icon": {
            "type": "icon",
            "value": "abc",
        },
        "onPressed": {
            "_type": "listener",
            "name": "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