Skip to content

Add Submenu support to Dropdown componentΒ #2559

Open
@garygong

Description

@garygong

Add submenu support to the Dropdown component according to the spec: https://lightningdesignsystem.com/components/menus/#With-a-Submenu

Here's a proposal for how to represent submenu items:

Untitled

[
    {
        "id": "1",
        "label": "Menu Item One",
        "type": "item",
        "value": "1"
    },
    {
        "id": "2",
        "label": "Menu Item Two",
        "type": "item",
        "value": "2"
    },
    {
        "id": "3",
        "label": "Menu Item Three",
        "type": "item",
        "value": "3",
        "options": [
            {
                "id": "3-1",
                "label": "Submenu Item One",
                "type": "item",
                "value": "3-1"
            },
            {
                "id": "3-2",
                "label": "Submenu Item Two",
                "type": "item",
                "value": "3-2"
            },
            {
                "id": "3-3",
                "label": "Submenu Item Three",
                "type": "item",
                "value": "3-3"
            },
            {
                "type": "divider"
            },
            {
                "id": "3-4",
                "label": "Submenu Item Four",
                "type": "item",
                "value": "3-4"
            }
        ]
    }
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions