dash-bootstrap-components icon indicating copy to clipboard operation
dash-bootstrap-components copied to clipboard

HTML in DropdownMenu label

Open jesse-r-s-hines opened this issue 3 years ago • 0 comments

DropdownMenu.label is a string prop, and so prevents putting any HTML in the dropdown toggle. If label could accept a node array we'd be able to put things such as icons in the dropdown toggle, e.g.

dbc.DropdownMenu(
    children=[
        dbc.DropdownMenuItem("Item 1", href="#"),
        dbc.DropdownMenuItem("Item 2", href="#"),
    ],
    label=[
        html.I(className="fa-solid fa-house"),
       "Home",
    ],
)

jesse-r-s-hines avatar Sep 09 '22 13:09 jesse-r-s-hines